示例#1
0
        public void TestBorderingToEachOtherEuropa()
        {
            Game game = new Game("world war 2", 2);

            Territory t9 = game.getTerritory(9);
            Territory t10 = game.getTerritory(10);
            Territory t11 = game.getTerritory(11);
            Territory t12 = game.getTerritory(12);
            Territory t13 = game.getTerritory(13);
            Territory t14 = game.getTerritory(14);
            Territory t15 = game.getTerritory(15);
            Territory t2 = game.getTerritory(2);

            // test 10 and 12
            Assert.IsTrue(game.territoryBorderToEachOther(t10, t9));
            Assert.IsTrue(game.territoryBorderToEachOther(t10, t11));
            Assert.IsTrue(game.territoryBorderToEachOther(t10, t12));
            Assert.IsTrue(game.territoryBorderToEachOther(t10, t14));
            Assert.IsTrue(game.territoryBorderToEachOther(t10, t15));

            Assert.IsFalse(game.territoryBorderToEachOther(t10, t13));

            Assert.IsTrue(game.territoryBorderToEachOther(t12, t13));
            Assert.IsTrue(game.territoryBorderToEachOther(t12, t11));
            Assert.IsTrue(game.territoryBorderToEachOther(t12, t14));
        }
示例#2
0
        public void TestBorderingToEachOtherNorthAmerica()
        {
            Game game = new Game("world war 2", 2);

            Territory t1 = game.getTerritory(1);
            Territory t2 = game.getTerritory(2);
            Territory t3 = game.getTerritory(3);
            Territory t4 = game.getTerritory(4);
            Territory t5 = game.getTerritory(5);
            Territory t6 = game.getTerritory(6);
            Territory t7 = game.getTerritory(7);
            Territory t8 = game.getTerritory(8);
            Territory t9 = game.getTerritory(9);

            Assert.IsTrue(game.territoryBorderToEachOther(t1, t3));
            Assert.IsTrue(game.territoryBorderToEachOther(t1, t7));
            Assert.IsTrue(game.territoryBorderToEachOther(t1, t2));

            Assert.IsTrue(game.territoryBorderToEachOther(t4, t5));
            Assert.IsTrue(game.territoryBorderToEachOther(t4, t7));
            Assert.IsTrue(game.territoryBorderToEachOther(t4, t3));

            Assert.IsTrue(game.territoryBorderToEachOther(t7, t1));
            Assert.IsTrue(game.territoryBorderToEachOther(t7, t2));
            Assert.IsTrue(game.territoryBorderToEachOther(t7, t8));

            Assert.IsFalse(game.territoryBorderToEachOther(t1, t4));
            Assert.IsFalse(game.territoryBorderToEachOther(t1, t8));
            Assert.IsFalse(game.territoryBorderToEachOther(t1, t9));

            Assert.IsFalse(game.territoryBorderToEachOther(t8, t1));
            Assert.IsFalse(game.territoryBorderToEachOther(t8, t8));
            Assert.IsFalse(game.territoryBorderToEachOther(t8, t9));
        }