package de.fhdw.gaming.ipspiel23.ssp.strategy;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import de.fhdw.gaming.ipspiel23.ssp.domain.SspStrategy;
import de.fhdw.gaming.ipspiel23.ssp.domain.factory.SspStrategyFactory;
import de.fhdw.gaming.ipspiel23.ssp.moves.factory.SspMoveFactory;
import de.fhdw.gaming.ipspiel23.ssp.moves.impl.SspDefaultMoveFactory;
/**
* Tests the equals operations of the different strategies.
*/
final class SspStrategyEqualsTest {
/**
* The factory for creating SSP moves.
*/
private final SspMoveFactory moveFactory = new SspDefaultMoveFactory();
/**
* The factories for creating the SSP strategies to be tested.
*/
private final SspStrategyFactory[] factories = new SspStrategyFactory[] {
new SspSayPaperStrategyFactory(),
new SspSayScissorsStrategyFactory(),
new SspSayStoneStrategyFactory(),
new SspMixedStrategyFactory()
};
Array initialization can be written shorter.
When declaring and initializing array fields or variables, it is not necessary to explicitly create a new array
using `new`. Instead one can simply define the initial content of the array as a expression in curly braces.
E.g. `int[] x = new int[] { 1, 2, 3 };` can be written as `int[] x = { 1, 2, 3 };`.
Foo[] x = new Foo[] { ... }; // Overly verbose
Foo[] x = { ... }; //Equivalent to above line