public void GetNextMovementReturnsAPlayingMessageIfGameContinues() { WordTreeManager manager = new WordTreeManager(_providerMock, _configurationMock); GhostGameResponseDto response = manager.GetNextMovement("t"); Assert.IsNotNull(response); Assert.AreEqual(GameStatus.Playing, response.GameStatus); Assert.IsFalse(string.IsNullOrEmpty(response.Message)); Assert.IsFalse(string.IsNullOrEmpty(response.CurrentWord)); }
public void GetNextMovementReturnsAHumanWonMessageIfTheOnlyOptionLeftIsEndingAWord() { WordTreeManager manager = new WordTreeManager(_providerMock, _configurationMock); GhostGameResponseDto response = manager.GetNextMovement("w"); Assert.IsNotNull(response); Assert.AreEqual(GameStatus.HumanPlayerWon, response.GameStatus); Assert.IsFalse(string.IsNullOrEmpty(response.Message)); Assert.IsFalse(string.IsNullOrEmpty(response.CurrentWord)); }
public void GetNextMovementReturnsAComputerWonResponseIfWordDoesNotExist() { WordTreeManager manager = new WordTreeManager(_providerMock, _configurationMock); GhostGameResponseDto response = manager.GetNextMovement("x"); Assert.IsNotNull(response); Assert.AreEqual(GameStatus.ComputerWon, response.GameStatus); Assert.IsFalse(string.IsNullOrEmpty(response.Message)); Assert.IsFalse(string.IsNullOrEmpty(response.CurrentWord)); }
public void GetNextMovementReturnsAComputerWonResponseIfWordCompletesATreeBranch() { WordTreeManager manager = new WordTreeManager(_providerMock, _configurationMock); manager.LastSelectedNode = manager.GetCurrentNode("g"); GhostGameResponseDto response = manager.GetNextMovement("go"); Assert.IsNotNull(response); Assert.AreEqual(GameStatus.ComputerWon, response.GameStatus); Assert.IsFalse(string.IsNullOrEmpty(response.Message)); Assert.IsFalse(string.IsNullOrEmpty(response.CurrentWord)); }