Beispiel #1
0
        public void TestAdd3()
        {
            var position = new SetOfItems();

            position.AddItem(new Item("wc1"));
            position.AddItem(new Item("wb4"));
            Assert.AreEqual(2, position.Arrangement.Count);
            Assert.AreEqual(2, position.Arrangement[1].Coordinates.FirstCoordinate);
            Assert.AreEqual(4, position.Arrangement[1].Coordinates.SecondCoordinate);
        }
Beispiel #2
0
        public void TestSimpleMoves3()
        {
            var first  = new Item(1, 3, ColourNames.Black);
            var second = new Item(2, 2, ColourNames.Black);
            var set    = new SetOfItems();

            set.AddItem(first);
            set.AddItem(second);
            var temp  = new ItemInPlay(first, set);
            var moves = temp.Moves();

            Assert.AreEqual(0, moves.Count());
        }
Beispiel #3
0
        public void TestSimpleMovesForBlack2()
        {
            var first  = new Item(4, 8, ColourNames.Black);
            var second = new Item(2, 2, ColourNames.White);
            var third  = new Item(3, 7, ColourNames.White);
            var set    = new SetOfItems();

            set.AddItem(first);
            set.AddItem(second);
            set.AddItem(third);
            var temp  = new ItemInPlay(first, set);
            var moves = temp.SimpleMovesForBlack();

            Assert.AreEqual(1, moves.Count());
        }
Beispiel #4
0
        public void TestAdd()
        {
            var position = new SetOfItems();
            var first    = new Item(3, 1, ColourNames.White);

            position.AddItem(first);
            Assert.AreEqual(1, position.Arrangement.Count);
        }
Beispiel #5
0
        public void TestAdd2()
        {
            var position = new SetOfItems();
            var first    = new Item(3, 1, ColourNames.White);

            position.AddItem(first);
            Assert.AreEqual(3, position.Arrangement[0].Coordinates.FirstCoordinate);
            Assert.AreEqual(1, position.Arrangement[0].Coordinates.SecondCoordinate);
        }
Beispiel #6
0
        public void TestCreation()
        {
            var first = new Item(3, 1, ColourNames.White);
            var set   = new SetOfItems();

            set.AddItem(first);
            var temp = new ItemInPlay(first, set);

            Assert.AreEqual(1, temp.State.Arrangement.Count);
        }
Beispiel #7
0
        public void TestSimpleMoveForBlack1()
        {
            var first = new Item(1, 3, ColourNames.Black);
            var set   = new SetOfItems();

            set.AddItem(first);
            var temp  = new ItemInPlay(first, set);
            var moves = temp.SimpleMovesForBlack();

            Assert.AreEqual(1, moves.Count());
        }
Beispiel #8
0
        public void TestSimpleMoveForWhite1()
        {
            var first = new Item(1, 3, ColourNames.White);
            var set   = new SetOfItems();

            set.AddItem(first);
            var temp  = new ItemInPlay(first, set);
            var moves = temp.SimpleMovesForWhite();

            Assert.AreEqual(1, moves.Count());
            Assert.AreEqual(2, moves.Moves[0].Points.Count);
        }
Beispiel #9
0
        public void TestSimpleMovesForWhite3()
        {
            var first  = new Item(1, 3, ColourNames.White);
            var place1 = new Square(1, 3);
            var place2 = new Square(2, 4);
            var set    = new SetOfItems();

            set.AddItem(first);
            var temp  = new ItemInPlay(first, set);
            var moves = temp.SimpleMovesForWhite();

            Assert.AreEqual(true, moves.Moves[0].AreEqual(0, place1));
            Assert.AreEqual(true, moves.Moves[0].AreEqual(1, place2));
        }
Beispiel #10
0
        public void TestSimpleMoves2()
        {
            var first  = new Item(1, 3, ColourNames.Black);
            var place1 = new Square(1, 3);
            var place2 = new Square(2, 2);
            var set    = new SetOfItems();

            set.AddItem(first);
            var temp  = new ItemInPlay(first, set);
            var moves = temp.Moves();

            Assert.AreEqual(1, moves.Count());
            Assert.AreEqual(true, moves.Moves[0].AreEqual(0, place1));
            Assert.AreEqual(true, moves.Moves[0].AreEqual(1, place2));
        }