Exemplo n.º 1
0
 public void EndGameTest1()
 {
     List<Flower> flowers = new List<Flower>()
     {
         new Flower(new Vector2(0, 0), 0),
         new Flower(new Vector2(500, 300), 1),
         new Flower(new Vector2(300, 150), 2),
     };
     List<Fence> fences = new List<Fence>()
     {
         new Fence(flowers[0],flowers[1]),
         new Fence(flowers[1],flowers[2]),
         new Fence(flowers[2],flowers[0]),
     };
     GardenGraph gg = new GardenGraph(flowers, fences);
     GraphColoring.Game game = new GraphColoring.Game(GameType.EdgesColoring, gg, 0);
     bool result;
     game.CheckIfEnd(out result);
     Assert.AreEqual(false, result);
 }
Exemplo n.º 2
0
        public void EndGameTest3()
        {
            List<Flower> flowers = new List<Flower>()
            {
                new Flower(new Vector2(0, 0), 0),
                new Flower(new Vector2(500, 300), 1),
                new Flower(new Vector2(300, 150), 2),
            };
            List<Fence> fences = new List<Fence>()
            {
                new Fence(flowers[0],flowers[1]),
                new Fence(flowers[1],flowers[2]),
                new Fence(flowers[2],flowers[0]),
            };
            GardenGraph gg = new GardenGraph(flowers, fences);

            GraphColoring.Game game = new GraphColoring.Game(GameType.VerticesColoring, gg, 1);
            gg.MakeMove(flowers[0], game.colors[0], game);
            bool result;
            bool res;
            result = game.CheckIfEnd(out res);
            Assert.AreEqual(true, result);
        }