Beispiel #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);
 }
Beispiel #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);
        }
Beispiel #3
0
 public void ValidMoveTest2()
 {
     List<Flower> flowers = new List<Flower>()
     {
         new Flower(new Vector2(0, 0), 0),
         new Flower(new Vector2(500, 300), 1),
     };
     List<Fence> fences = new List<Fence>()
     {
         new Fence(flowers[0],flowers[1]),
     };
     GardenGraph gg = new GardenGraph(flowers, fences);
     GraphColoring.Game game = new GraphColoring.Game(GameType.EdgesColoring, gg, 0);
     flowers[0].color = Color.Red;
     bool result = game.CheckIfValidMove(flowers[1], Color.Red);
     Assert.AreEqual(false, result);
 }