public void TearDown() { if (TestContext.CurrentContext.Result.Outcome != ResultState.Failure) { return; } var failedTestsPath = TestContext.CurrentContext.TestDirectory + @"\FailedTests"; if (!Directory.Exists(failedTestsPath)) { Directory.CreateDirectory(failedTestsPath); } var cloudDrawer = new RectangleCloudDrawer(Color.Teal, Brushes.Peru, Brushes.Black); var filename = failedTestsPath + $"\\{TestContext.CurrentContext.Test.FullName}.png"; cloudDrawer.DrawRectangles(rectangles, filename); TestContext.WriteLine($"Tag cloud visualisation saved to file: '{filename}'"); }
private static void GenerateTagCloud(IEnumerable <TagInfo> tags, string filename) { var cloudDrawer = new RectangleCloudDrawer(Color.Teal, Brushes.Peru, Brushes.Black); cloudDrawer.DrawCloud(tags.ToList(), Environment.CurrentDirectory + $"\\Examples\\{filename}.png"); }