public void ControllerReturnsAllGamesWhenIsRequested() { var game1 = new Game("gameName", GameType.Public, "owner"); var game2 = new Game("game", GameType.Public, "doge"); var mockRepo = new MockGameRepository(); mockRepo.SaveGame(game1); mockRepo.SaveGame(game2); var sut = new GamesRestfullController(mockRepo); Assert.Equal(2, mockRepo.FindAllGames().Count()); }
public void ControllerReturnsGameWhenGameOwnerIdIsGiven(string gameName, string gameOwner) { var game = new Game(gameName, GameType.Public, gameOwner); var anotherGame = new Game(gameName, GameType.Public, gameOwner); var games = new List<Game>(); var mockRepo = new MockGameRepository(); mockRepo.SaveGame(game); mockRepo.SaveGame(anotherGame); games.Add(game); games.Add(anotherGame); var sut = new GamesRestfullController(mockRepo); Assert.Equal(games, mockRepo.FindGamesByOwnerId(gameOwner)); }
public void SaveGame(Game game) { games.Add(game); }
public void SaveGame(Game game) { _database.GetCollection<Game>().Save(game); }
public void SaveGame(Game game) { SaveCallCount++; LastGame = game; }