Exemplo n.º 1
0
        public GameSessionManager(string username, DifficultyLevel difficultyLevel)
        {
            _username = username;
            _gameMap  = GameMapFactory.GetGameMap(difficultyLevel);

            //In real world it will be injected via a DI container.
            _scoringService = new ConsoleScoringService();
        }
Exemplo n.º 2
0
        public void GameMapFactoryEasyLevelReturnsProperStuff()
        {
            //Arrange
            GameMap gameMap;

            //Act
            gameMap = GameMapFactory.GetGameMap(DifficultyLevel.Low);

            //Assert + manual debug inspect
            Assert.NotNull(gameMap);
        }
Exemplo n.º 3
0
        public void NewHardGameMapHasNineLivingMonstersAndOnePlayerWithFullTenLife()
        {
            //Arrange
            GameMap gameMap = GameMapFactory.GetGameMap(DifficultyLevel.High);

            //Act
            Tuple <int, int> gameConditions = gameMap.GetGameConditions();

            //Assert
            Assert.Equal(10, gameConditions.Item1);
            Assert.Equal(9, gameConditions.Item2);
        }