public CloudPainter(IImageHolder imageHolder, ICircularCloudLayouterSettings settings, IPalette palette, ICircularCloudLayouter layouter) { this.imageHolder = imageHolder; this.settings = settings; this.palette = palette; this.layouter = layouter; this.rnd = new Random(); imageSize = imageHolder.GetImageSize(); }
public void SetUp() { imageHolder = A.Fake <IImageHolder>(); settings = A.Fake <ICircularCloudLayouterSettings>(); palette = A.Fake <IPalette>(); layouter = A.Fake <ICircularCloudLayouter>(); graphics = A.Fake <IGraphicDrawer>(); A.CallTo(() => imageHolder.GetImageSize()).Returns(new Size(600, 600)); A.CallTo(() => imageHolder.StartDrawing()).Returns(graphics); A.CallTo(() => settings.MinSize).Returns(10); A.CallTo(() => settings.MaxSize).Returns(30); A.CallTo(() => settings.CenterX).Returns(300); A.CallTo(() => settings.CenterY).Returns(300); A.CallTo(() => settings.IterationsCount).Returns(5); A.CallTo(() => settings.XCompression).Returns(1); A.CallTo(() => settings.YCompression).Returns(1); A.CallTo(() => palette.PrimaryColor).Returns(Color.Black); A.CallTo(() => palette.BackgroundColor).Returns(Color.Black); A.CallTo(() => palette.SecondaryColor).Returns(Color.Black); }
private Size GetRandomSize(ICircularCloudLayouterSettings settings) { return(new Size(rnd.Next(settings.MinSize, settings.MaxSize), rnd.Next(settings.MinSize, settings.MaxSize))); }