示例#1
0
文件: Program.cs 项目: Jevvry/tdd
        static void Main()
        {
            var layout = new CircularCloudLayouter(new Point(200, 200));
            var random = new Random();

            for (int i = 1; i < 50; i++)
            {
                layout.PutNextRectangle(new Size(random.Next(30, 60), random.Next(20, 60)));
            }
            CircularCloudVisualization.SaveImageFromLayout("Test", layout);
        }
示例#2
0
        public static void SaveImageOfWrongTestCase()
        {
            if (TestContext.CurrentContext.Result.Outcome.Status != TestStatus.Failed)
            {
                return;
            }

            var directory = TestContext.CurrentContext.TestDirectory;
            var path      = $"{directory}\\..\\..\\Images\\FailedOn{TestContext.CurrentContext.Test.Name}.png";

            TestContext.Out.WriteLine($"Tag cloud visualization saved to file {path}");

            var bitmap = CircularCloudVisualization.GetBitmapWithRectangles(cloudLayouter);

            bitmap.Save(path, ImageFormat.Png);
        }