Ejemplo n.º 1
0
 public AppSettings(ImageSettings imageSettings, PictureBoxImageHolder imageHolder, Palette palette,
                    Restrictions restrictions)
 {
     ImageSettings = imageSettings;
     ImageHolder   = imageHolder;
     Palette       = palette;
     Restrictions  = restrictions;
 }
Ejemplo n.º 2
0
        public void PictureBox_RecreateImage_ShouldUseSizeFromInput()
        {
            var size       = new Size(300, 300);
            var pictureBox = new PictureBoxImageHolder();

            pictureBox.RecreateImage(new ImageSettings {
                Width = size.Width, Height = size.Height
            });

            pictureBox.GetImageSize().Should().Be(size);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            fontSettings  = new FontSettings();
            imageSettings = new ImageSettings();
            filesSettings = new FilesSettings();
            var imageHolder = new PictureBoxImageHolder();

            imageHolder.RecreateImage(imageSettings);
            tagCreator = new TagCreator(fontSettings, new SpiralCloudLayouter(imageSettings),
                                        new TextAnalyzer(filesSettings), imageHolder);

            filesSettings.TextFilePath        = @"..\..\testTextAnalyzer.txt";
            filesSettings.BoringWordsFilePath = @"..\..\boring words.txt";
        }
Ejemplo n.º 4
0
 public CloudDrawAction(IFileReader reader,
                        IWordsPreprocessor[] preprocessors,
                        FrequencyCounter frequencyCounter,
                        WordsPreprocessorSettings preprocessorSettings,
                        IFilePathProvider filePath,
                        TagCloudPainter painter,
                        LayouterApplicator applicator,
                        PictureBoxImageHolder imageHolder)
 {
     this.reader               = reader;
     this.preprocessors        = preprocessors;
     this.frequencyCounter     = frequencyCounter;
     this.preprocessorSettings = preprocessorSettings;
     this.filePath             = filePath;
     this.painter              = painter;
     this.applicator           = applicator;
     this.imageHolder          = imageHolder;
 }
Ejemplo n.º 5
0
        public void SetUp()
        {
            imageSettings = new ImageSettings();
            var imageHolder = new PictureBoxImageHolder();

            imageHolder.RecreateImage(imageSettings);
            var colorSettingsProvider = new ColorSettingsProvider();
            var filesSettings         = new FilesSettings();

            filesSettings.TextFilePath        = "..\\..\\testTextAnalyzer.txt";
            filesSettings.BoringWordsFilePath = "..\\..\\boring words.txt";
            var textAnalyzer = new TextAnalyzer(filesSettings);

            fontSettings = new FontSettings();
            var tagCreator = new TagCreator(fontSettings, new SpiralCloudLayouter(imageSettings), textAnalyzer,
                                            imageHolder);

            painter = new Painter(colorSettingsProvider, imageHolder, tagCreator);
        }
Ejemplo n.º 6
0
        public void PictureBox_SaveImage_ShouldThrowExceptionWhenNoPicture()
        {
            var pictureBox = new PictureBoxImageHolder();

            pictureBox.Invoking(x => x.SaveImage("test.png")).Should().Throw <InvalidOperationException>();
        }
Ejemplo n.º 7
0
        public void PictureBox_GetImageSize_ShouldThrowExceptionWhenNoPicture()
        {
            var pictureBox = new PictureBoxImageHolder();

            pictureBox.Invoking(x => x.GetImageSize()).Should().Throw <InvalidOperationException>();
        }