示例#1
0
 public TagCloudCreator(
     IEnumerable <IWordPreparer> preparers,
     ITagCloudStatsGenerator generator,
     TagCloudImageCreator imageCreator)
 {
     this.preparers    = preparers;
     this.generator    = generator;
     this.imageCreator = imageCreator;
 }
示例#2
0
        public static void Main(string[] args)
        {
            var circularCloudLayouter = new CircularCloudLayouter(new Point(500, 500));

            for (var i = 0; i < 50; i++)
            {
                circularCloudLayouter.PutNextRectangle(new Size(50 + i, 50 - i));
            }
            var cloudImageCreator = new TagCloudImageCreator(circularCloudLayouter);

            cloudImageCreator.Save();
        }
示例#3
0
        public void TearDown()
        {
            if (!Directory.Exists($@"C:\\TagCloudTests"))
            {
                Directory.CreateDirectory($@"C:\\TagCloudTests");
            }
            if (TestContext.CurrentContext.Result.Outcome != ResultState.Failure)
            {
                return;
            }
            var tagCloudImageCreator = new TagCloudImageCreator(circularCloudLayouter);
            var testName             = TestContext.CurrentContext.Test.FullName;
            var path = $@"C:\\TagCloudTests\{testName}.jpg";

            tagCloudImageCreator.Save(path);
            Console.WriteLine($"Tag cloud visualization saved to file {path}");
        }