Exemple #1
0
        private IMineField CreateMineField([NotNull] string text)
        {
            var converter = new StringToMineFieldConverter();

            IMineField minefield = converter.ToMineField(text);

            return(minefield);
        }
Exemple #2
0
        public void FunctionUnderTest_ExpectedResult_UnderCondition()
        {
            // Arrange
            StringToMineFieldConverter sut = CreateSut();

            // Act
            IMineField actual = sut.ToMineField(m_MineFieldWithTwoMines);

            // Assert
            actual.IsMineAt(0,
                            0).ShouldBeTrue("[0,0] Here should be a Mine");
            actual.IsMineAt(0,
                            1).ShouldBeFalse("[0,1] Here should not be a Mine");
            actual.IsMineAt(1,
                            0).ShouldBeFalse("[1,0] Here should not be a Mine");
            actual.IsMineAt(1,
                            1).ShouldBeTrue("[1,1] Here should be a Mine");
        }