private static void GenerateLayoutAndSaveToFile(string filePath, Point center, Size canvasSize, int rectCount) { var layouter = new CircularCloudLayouter(center); var placedRectangles = RandomEntitiesFabric.GetRandomLayout(layouter, rectCount); using (var painter = new CloudPainter(canvasSize)) { painter.PaintRectangles(placedRectangles) .SaveToFile(filePath); } }
public void TearDown() { if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Passed || currentLayout.Count == 0) { return; } var name = TestContext.CurrentContext.Test.Name; var path = Path.Combine(TestContext.CurrentContext.TestDirectory, $"{name}.bmp"); using (var painter = new CloudPainter(new Size(CanvasSideLength, CanvasSideLength))) { painter.PaintRectangles(currentLayout) .SaveToFile(path); } Console.WriteLine($"Tag cloud visualization saved to file {path}"); }