Ejemplo n.º 1
0
        public void FindAllAdjacentUnitsCorner()
        {
            IocContainer.Setup();

            var terrainMap = new TerrainMap(new ShortestPath());

            terrainMap.InitializeBoard(8, 8);

            var unitList = new UnitList(new BattleCalculator(new DieRoller()), terrainMap);

            unitList.Add(2, 1, 1, NATIONALITY.GreatBritian);
            unitList.Add(1, 2, 1, NATIONALITY.France);
            unitList.Add(2, 2, 1, NATIONALITY.France);

            var result = unitList.FindAllAdjacentUnits(1, 1);

            Assert.Equal(3, result.Count);
        }
Ejemplo n.º 2
0
        public void FindAllAdjacentUnitsMiddle()
        {
            IocContainer.Setup();

            var terrainMap = new TerrainMap(new ShortestPath());

            terrainMap.InitializeBoard(8, 8);

            var unitList = new UnitList(new BattleCalculator(new DieRoller()), terrainMap);

            unitList.Add(3, 3, 1, NATIONALITY.GreatBritian);
            unitList.Add(3, 4, 1, NATIONALITY.France);
            unitList.Add(3, 5, 1, NATIONALITY.France);
            unitList.Add(4, 3, 1, NATIONALITY.France);
            unitList.Add(4, 5, 1, NATIONALITY.Germany);
            unitList.Add(5, 3, 1, NATIONALITY.USA);
            unitList.Add(5, 4, 1, NATIONALITY.France);
            unitList.Add(5, 5, 1, NATIONALITY.Japan);

            var result = unitList.FindAllAdjacentUnits(4, 4);

            Assert.Equal(8, result.Count);
        }