public void CreateImade_IfTestFails() { if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed) { var path = Path.Combine(TestContext.CurrentContext.TestDirectory, TestContext.CurrentContext.Test.Name + ".bmp"); var vizualizer = new Vizualizer(); var layout = vizualizer.GetLayoutImage(layouter.TagsCloud.Rectangles); vizualizer.SaveImage(path, layout); Console.WriteLine($"Tag cloud visualization saved to file {path}"); } }
static void Main(string[] args) { var path = Path.Combine(Directory.GetCurrentDirectory(), "cloud.bmp"); /*var cloudAreaSize = new Size(2500, 2500); * var cloudAreaFrame = new Rectangle(new Point(0, 0), cloudAreaSize); * var cloudCenter = new Point((int) (cloudAreaFrame.X + cloudAreaSize.Width / 2), * (int) (cloudAreaFrame.Y + cloudAreaSize.Height / 2)); */ var testingLayouter = new TestingCircularLayoutGenerator(new Point(500, 45)); var cloud = testingLayouter.GenerateTestLayout(); var visualizer = new Vizualizer(); var img = visualizer.GetLayoutImage(cloud); visualizer.SaveImage(path, img); }