コード例 #1
0
        public void CloudPainter_ShouldCallUpdate_OnlyOnce()
        {
            var painter = new CloudPainter(imageHolder, settings, palette, layouter);

            painter.Paint();

            A.CallTo(() => imageHolder.UpdateUi()).WithAnyArguments().MustHaveHappenedOnceExactly();
        }
コード例 #2
0
        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);
コード例 #3
0
        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);
        }