예제 #1
0
        public void FieldMarkedAsMine_UndoExecuteMarkAsMineCommand_FieldIsNotMarkedAsMine()
        {
            this.Minefield = TestMinefieldFactory.CreateMinefield(MarkedMine);
            var command = new MarkAsMineCommand(this.Minefield, this.Middle);

            command.UndoExecution();

            Assert.Equal(0, Minefield.Count(x => x.BombMarked)); // Too many fields marked as mine.
        }
예제 #2
0
        public void FieldNotMarkedAsMine_ExecuteMarkAsMineCommand_FieldIsMarkedAsMine()
        {
            this.Minefield = TestMinefieldFactory.CreateMinefield(HiddenMine);
            var command = new MarkAsMineCommand(this.Minefield, this.Middle);

            command.Execute();

            Assert.True(Minefield.GetValue(Middle).BombMarked);  // Field not marked as mine.
            Assert.Equal(1, Minefield.Count(x => x.BombMarked)); // Too many fields marked as mine.
        }