Example #1
0
        public void GivenTheSquareHasNoMinesAsNeighborsThenAllMyNeighborsAreExposed()
        {
            var square = new Square(false);

            square.Neighbors = SquareTestHelpers.GenerateSquares(3);
            square.Uncover();

            square.Neighbors.ForEach(s => Assert.That(s.IsCovered, Is.False));
        }
Example #2
0
        public void GivenTheSquareIsCoveredThenTheSquareIsFlagged()
        {
            var square = new Square(false);

            square.Neighbors = SquareTestHelpers.GenerateSquares(3);

            square.ToggleFlag();

            Assert.That(square.IsFlagged, Is.True);
        }
Example #3
0
        public void GivenTheSquareIsUncoveredThenNothingHappens()
        {
            var square = new Square(false);

            square.Neighbors = SquareTestHelpers.GenerateSquares(3);
            square.Uncover();

            square.ToggleFlag();

            Assert.That(square.IsFlagged, Is.False);
        }
Example #4
0
        public void GivenTheSquareIsFlaggedThenTheSquareIsUnflagged()
        {
            var square = new Square(false);

            square.Neighbors = SquareTestHelpers.GenerateSquares(3);

            square.ToggleFlag();             //This makes it flagged
            square.ToggleFlag();             //This makes it unflagged

            Assert.That(square.IsFlagged, Is.False);
        }