Exemplo n.º 1
0
        private HintField CreateSut(IMineField mineField)
        {
            var hintCompass = new HintCompass(mineField);
            var hintField   = new HintField(HintCompassFactory,
                                            mineField);

            return(hintField);
        }
Exemplo n.º 2
0
        private HintField CreateSut(IMineField mineField)
        {
            var hintCompass = new HintCompass(mineField); // todo replace with Substitute?
            var factory     = Substitute.For <IHintCompassFactory>();

            factory.Create(Arg.Any <IMineField>())
            .Returns(hintCompass);

            var hintField = new HintField(factory,
                                          mineField);

            return(hintField);
        }
Exemplo n.º 3
0
        public void GetMineCountFor_ReturnsMineCount_For3x3AndMinesAroundCentre(int row,
                                                                                int column,
                                                                                int expected)
        {
            // Arrange
            IMineField  mineField = CreateMineFieldWith3x3AndMinesAroundCentre();
            HintCompass sut       = CreateSut(mineField);

            // Act
            int actual = sut.GetMineCountFor(row,
                                             column);

            // Assert
            Assert.AreEqual(expected,
                            actual);
        }
Exemplo n.º 4
0
        private HintCompass CreateSut(IMineField mineField)
        {
            var compass = new HintCompass(mineField);

            return(compass);
        }