Exemplo n.º 1
0
        public void GetWinnableConnectionAround_OnEdge()
        {
            object player1 = new object();
            object player2 = new object();

            var tc = new TileConnection(new List<Tile>() {
                new Tile(new Column(0), 1, player1),
                new Tile(new Column(1), 1, player1),
                new Tile(new Column(2), 1),
                new Tile(new Column(3), 1),
                new Tile(new Column(4), 1),
                new Tile(new Column(5), 1),
                new Tile(new Column(6), 1)
            });

            var winnable = tc.GetWinnableConnectionAround(tc.Tiles[0]);

            //4,1 + is out since it's too far away
            Assert.AreEqual(4, winnable.Tiles.Count);
            Assert.AreEqual("[0,1] - [3,1]", winnable.ToString());
        }
Exemplo n.º 2
0
        public void GetWinnableConnectionAround_Simple()
        {
            object player1 = new object();
            object player2 = new object();

            var tc = new TileConnection(new List<Tile>() {
                new Tile(new Column(0), 1, player2),
                new Tile(new Column(1), 1),
                new Tile(new Column(2), 1, player1),
                new Tile(new Column(3), 1),
                new Tile(new Column(4), 1),
                new Tile(new Column(5), 1),
                new Tile(new Column(6), 1)
            });

            var winnable = tc.GetWinnableConnectionAround(tc.Tiles[2]);

            //0,1 is out since it's the wrong player
            //6,1 is out since it's too far away
            Assert.AreEqual(5, winnable.Tiles.Count);
            Assert.AreEqual("[1,1] - [5,1]", winnable.ToString());
        }