public void CloudPainter_ShouldCallUpdate_OnlyOnce() { var painter = new CloudPainter(imageHolder, settings, palette, layouter); painter.Paint(); A.CallTo(() => imageHolder.UpdateUi()).WithAnyArguments().MustHaveHappenedOnceExactly(); }
public void CloudPainter_ShouldCallDrawRectangle_ExactTimesThatSpecifiedInSettings() { var iterations = 10; A.CallTo(() => settings.IterationsCount).Returns(iterations); var painter = new CloudPainter(imageHolder, settings, palette, layouter); painter.Paint(); A.CallTo(() => graphics.DrawRectangle(default, default)).WithAnyArguments().MustHaveHappened(iterations, Times.Exactly);
public void CloudPainter_ShouldCallLayouterExactTimesThatSpecifiedInSettings() { var iterations = 10; A.CallTo(() => settings.IterationsCount).Returns(iterations); var painter = new CloudPainter(imageHolder, settings, palette, layouter); painter.Paint(); A.CallTo(() => layouter.PutNextRectangle(new Size(10, 10))).WithAnyArguments().MustHaveHappened(iterations, Times.Exactly); }