public void getErrorCodeWhenAddinvalidTurnTaskEventTest() { SpyUIPresenter spyRolledDice = new SpyUIPresenter(); Dice[] dices = { new Dice1() }; Assert.AreEqual(0, spyRolledDice.lastStory.Length); RolePlayGameCoordinator gameCoordinator = new RolePlayGameCoordinator(new StubStoreGateway(), dices, spyRolledDice); gameCoordinator.addTurnTaskEvent("a", "a", 0, 0, 1, "d1", "invalidTask"); Assert.AreEqual("InvalidTaskType", spyRolledDice.lastErrorCode); }
public void throwWithNotExistsDiceTest() { SpyUIPresenter spyRolledDice = new SpyUIPresenter(); Dice[] dices = { new Dice1() }; Assert.AreEqual(0, spyRolledDice.lastStory.Length); RolePlayGameCoordinator gameCoordinator = new RolePlayGameCoordinator(new StubStoreGateway(), dices, spyRolledDice); gameCoordinator.addTurnOpponentEvent("a", "a", 0, 1, 1, "1", 0, false); Assert.AreEqual("NotSupportedDiceType|1", spyRolledDice.lastErrorCode); }
public void addTurnOpponentEventTest() { SpyUIPresenter spyRolledDice = new SpyUIPresenter(); Dice[] dices = { new Dice1() }; Assert.AreEqual(0, spyRolledDice.lastStory.Length); RolePlayGameCoordinator gameCoordinator = new RolePlayGameCoordinator(new StubStoreGateway(), dices, spyRolledDice); gameCoordinator.addTurnOpponentEvent("a", "a", 0, 1, 1, "d1", 0, false); Assert.AreEqual("", spyRolledDice.lastErrorCode); Assert.AreEqual(1, spyRolledDice.lastStory.Length); Assert.AreEqual(1, spyRolledDice.lastRolledDices.Length); }
public void setup() { spyUIPresenter = new SpyUIPresenter(); Dice[] dices = { new DiceMinus1(), new Dice1() }; string path = Directory.GetCurrentDirectory() + "\\" + GAME_NAME; DirectoryInfo directory = new DirectoryInfo(path); if (directory.Exists) { directory.Delete(true); } rolePlayGameCoordinator = new RolePlayGameCoordinator(new RolePlayFileStorage(), dices, spyUIPresenter); rolePlayGameCoordinator.generateNewGame(GAME_NAME); }
public void setup() { Dice[] dices = { new FakeDice() }; spyUIPresenter = new SpyUIPresenter(); rolePlayCoordinator = new RolePlayGameCoordinator(new StubStoreGateway(), dices, spyUIPresenter); }