public AppSettings(ImageSettings imageSettings, PictureBoxImageHolder imageHolder, Palette palette, Restrictions restrictions) { ImageSettings = imageSettings; ImageHolder = imageHolder; Palette = palette; Restrictions = restrictions; }
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); }
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"; }
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; }
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); }
public void PictureBox_SaveImage_ShouldThrowExceptionWhenNoPicture() { var pictureBox = new PictureBoxImageHolder(); pictureBox.Invoking(x => x.SaveImage("test.png")).Should().Throw <InvalidOperationException>(); }
public void PictureBox_GetImageSize_ShouldThrowExceptionWhenNoPicture() { var pictureBox = new PictureBoxImageHolder(); pictureBox.Invoking(x => x.GetImageSize()).Should().Throw <InvalidOperationException>(); }