Пример #1
0
        public void ToJsonClosedDigitTest()
        {
            var cell = new Cell();

            Assert.IsTrue(cell.IsClosed());
            Assert.AreEqual("F", cell.ToJson());
        }
Пример #2
0
        public void ToJson1DigitTest()
        {
            var cell = new Cell();

            cell.Carve(Direction.N);

            Assert.AreEqual("7", cell.ToJson());
        }
Пример #3
0
        public void IsNoyClosedIfMissAWallsTest()
        {
            var cell = new Cell();

            cell.Carve(Direction.N);

            Assert.IsFalse(cell.IsClosed());
        }
Пример #4
0
        public void IsClosedIfHasAllTheWallsTest()
        {
            var cell = new Cell();

            Assert.IsTrue(cell.HasWall(Direction.N));
            Assert.IsTrue(cell.HasWall(Direction.E));
            Assert.IsTrue(cell.HasWall(Direction.S));
            Assert.IsTrue(cell.HasWall(Direction.W));
            Assert.IsTrue(cell.IsClosed());
        }
Пример #5
0
        public void ToJsonOpenTest()
        {
            var cell = new Cell();

            cell.Carve(Direction.N);
            cell.Carve(Direction.E);
            cell.Carve(Direction.S);
            cell.Carve(Direction.W);

            Assert.AreEqual("0", cell.ToJson());
        }
Пример #6
0
        public void OnCarveOnDirectionOnlyThatWallDisapears()
        {
            var directions = new[] { Direction.N, Direction.E, Direction.W, Direction.S };

            foreach (var direction in directions)
            {
                var carved = new Cell().Carve(direction);

                foreach (var testDirection in directions)
                {
                    Assert.IsTrue(carved.HasWall(testDirection) == (direction != testDirection));
                }
            }
        }