예제 #1
0
        public void DarkCastleRegion_UnlockedAfterBeatingOtherAreas()
        {
            Region fieldsRegion       = new Region(WorldRegion.Fields, new BattleMove[0], new SubRegion[0]);
            Region desertRegion       = new Region(WorldRegion.Desert, new BattleMove[0], new SubRegion[0]);
            Region casinoRegion       = new Region(WorldRegion.Casino, new BattleMove[0], new SubRegion[0]);
            Region crystalCavesRegion = new Region(WorldRegion.CrystalCaves, new BattleMove[0], new SubRegion[0]);
            Region darkCastleRegion   = new Region(WorldRegion.DarkCastle, new BattleMove[0], new SubRegion[0]);

            AreaMap <Region, WorldRegion> regionalMap = _mapManager.GetRegionalMap(fieldsRegion, desertRegion, casinoRegion, crystalCavesRegion, darkCastleRegion);

            MapGroupingItem <Region, WorldRegion> darkCastleGroupItem = regionalMap.MapPaths.First(mp => mp.To.Values.FirstOrDefault(gi => gi.Item == darkCastleRegion) != null).To.Values.First(gi => gi.Item == darkCastleRegion);

            MockDecisionManager decisionManager = new MockDecisionManager(new GodRelationshipManager());

            int i = 0;

            for (; i < 3; ++i)
            {
                Assert.True(darkCastleGroupItem.IsLocked, "Dark Castle should be locked, not all requisite areas have been completed");
                decisionManager.SetGroupingChoice(i);
                regionalMap.Advance(decisionManager, new TestTeam());
            }

            decisionManager.SetGroupingChoice(i);
            Region finalRegion = null;

            Assert.DoesNotThrow(() => finalRegion = regionalMap.Advance(decisionManager, new TestTeam()));

            Assert.False(darkCastleGroupItem.IsLocked, "Dark Castle should be unlocked, all requisite areas have been completed");

            Assert.AreEqual(darkCastleRegion, finalRegion);
        }
예제 #2
0
        public void SetUp()
        {
            _chanceService = new MockChanceService();
            _output        = new MockOutput();
            _input         = new MockInput();
            _battleManager = new TestBattleManager(_chanceService, _input, _output);
            _config        = new SilentBattleConfiguration();
            _battleManager.SetConfig(_config);

            _teamFactory     = new TestTeamFactory(_chanceService);
            _mapManager      = new MockMapManager();
            _decisionManager = new MockDecisionManager(new GodRelationshipManager());
            _regionFactory   = new MockRegionFactory(_decisionManager);
            _groupingFactory = new GroupingFactory(_chanceService, _teamFactory, new FighterFactory());

            _humanFighter1 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _humanFighter2 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _humanTeam     = new Team(TestMenuManager.GetTestMenuManager(), _humanFighter1, _humanFighter2);

            _oneEnemyTeam = GetSingleEnemyTeam();
        }