private HintField CreateSut(IMineField mineField) { var hintCompass = new HintCompass(mineField); var hintField = new HintField(HintCompassFactory, mineField); return(hintField); }
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); }
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); }
private HintCompass CreateSut(IMineField mineField) { var compass = new HintCompass(mineField); return(compass); }