public void GetPlayer_Returns_Null() { var inMemoryDataStore = new InMemoryDataStore(); var output = inMemoryDataStore.GetPlayer("Alice"); Assert.Null(output); }
public void UpdateBoard_Returns_True() { var inMemoryDataStore = new InMemoryDataStore(); var player1 = new Player("Alice") { Board = new Board(10) }; inMemoryDataStore.AddPlayer(player1); var board = inMemoryDataStore.GetPlayer("Alice").Board; board.AttackHasStarted = true; var result = inMemoryDataStore.UpdateBoard("Alice", board); var updatedBoard = inMemoryDataStore.GetPlayer("Alice").Board; Assert.True(result); Assert.Equal(board.AttackHasStarted, updatedBoard.AttackHasStarted); }
public void AddPlayer_Success() { var inMemoryDataStore = new InMemoryDataStore(); var player = new Player("Alice") { Board = new Board(10) }; inMemoryDataStore.AddPlayer(player); var output = inMemoryDataStore.GetPlayer("Alice"); Assert.NotNull(output); Assert.Equal("Alice", output.Name); }