Beispiel #1
0
 public Spiral(Point center, CircularCloudLayouter cloudDrawer)
 {
     this.cloudDrawer = cloudDrawer;
     Center           = center;
     radius           = 0;
     radiusStep       = RadiusStepCoefficient * center.X / ScaleDivider;
 }
Beispiel #2
0
        public void ApprovalFunctionalTest_ShouldRenderUsingFormatter()
        {
            var formatterMock = new Mock <ITagsCloudFormatter>();

            formatterMock.SetupGet(m => m.FontFamily).Returns(FontFamily.GenericMonospace);
            formatterMock.SetupGet(m => m.BackgroundBrush).Returns(Brushes.Black);
            formatterMock.SetupGet(m => m.FontBrush).Returns(Brushes.Yellow);
            formatterMock.SetupGet(m => m.ImageSize).Returns(new Size(700, 700));

            var formatter = formatterMock.Object;

            var layouter = new CircularCloudLayouter(formatter, new Point(300, 300));
            var layout   = layouter.GetLayout(new[] { "word", "word", "word", "anotherWord", "oneMoreWord" });

            var renderer = new DefaultTagsCloudRenderer <Bitmap>(formatter);
            var bitmap   = renderer.Render(layout).GetRenderingResult();

            var filename    = $"{nameof(ApprovalFunctionalTest_ShouldRenderUsingFormatter)}.png";
            var bitmapSaver = new PngTagsCloudSaver(filename);

            bitmapSaver.Save(bitmap);

            Approvals.VerifyFile(filename);
        }
Beispiel #3
0
 public void SetUp()
 {
     ccl = new CircularCloudLayouter(new Point(500, 300));
 }