public GameEngineTests() { this.field = new GameField(GlobalConstants.DefaultLevelRows, GlobalConstants.DefaultLevelCols); this.game = new Game(this.field); this.gameLogic = new GameLogicProvider(this.game); this.mockPrinter = new MockIPrinter().MockPrinter.Object; this.topScoreController = new MockITopScoreController().MockTopScoreController.Object; this.gamesController = new MockIGamesController().MockGamesController.Object; this.gamesRepo = new MockIGenericRepository<Game>(this.GenerateFakeCollectionOfGames()); this.playersRepo = new MockIGenericRepository<Player>(this.GenerateFakeCollectionOfPlayers()); this.db = new BalloonsData(this.playersRepo.MockedRepo.Object, this.gamesRepo.MockedRepo.Object); }
public MockIContext() { this.field = new GameField(GlobalConstants.DefaultLevelRows, GlobalConstants.DefaultLevelCols); this.game = new Game(this.field); this.gameLogic = new GameLogicProvider(this.game); this.mockPrinter = new MockIPrinter().MockPrinter.Object; this.mockReader = new MockIReader("default").MockReader.Object; this.topScoreController = new MockITopScoreController().MockTopScoreController.Object; this.gamesController = new MockIGamesController().MockGamesController.Object; this.gamesRepo = new MockIGenericRepository<Game>(this.GenerateFakeCollectionOfGames()); this.playersRepo = new MockIGenericRepository<Player>(this.GenerateFakeCollectionOfPlayers()); this.db = new BalloonsData(this.playersRepo.MockedRepo.Object, this.gamesRepo.MockedRepo.Object); this.MockContext = new Mock<IContext>(); this.MockContext.SetupGet(x => x.DataBase).Returns(this.db); this.MockContext.SetupGet(x => x.GameLogic).Returns(this.gameLogic); this.MockContext.SetupGet(x => x.GamesController).Returns(this.gamesController); this.MockContext.SetupGet(x => x.TopScoreController).Returns(this.topScoreController); this.MockContext.SetupGet(x => x.Memory).Returns(new GameStateMemory()); this.MockContext.SetupGet(x => x.Printer).Returns(this.mockPrinter); this.MockContext.SetupGet(x => x.Reader).Returns(this.mockReader); }
public GamesControllerTests() { this.fakeGames = this.GenerateFakeCollectionOfGames(); this.gamesRepo = new MockIGenericRepository<Game>(this.fakeGames); this.gamesController = new GamesController(this.gamesRepo.MockedRepo.Object); }
public TopScoreControllerTests() { this.fakePlayers = this.GenerateFakeCollectionOfPlayers(); this.playersRepo = new MockIGenericRepository<Player>(this.fakePlayers); this.topScoreController = new TopScoreController(this.playersRepo.MockedRepo.Object); }