private void ConfigureDefaultFakes() { A.CallTo(() => textReader.Read(A <string> .Ignored)).Returns(new[] { "t", "y", "f" }); A.CallTo(() => wordsFilter.FilterWords(A <IEnumerable <string> > .Ignored)).Returns(new[] { "t", "y" }); A.CallTo(() => wordsCounter.CountWords(A <IEnumerable <string> > .Ignored)) .Returns(new Dictionary <string, int>() { { "t", 1 }, { "y", 1 } }); A.CallTo(() => wordsToSizesConverter.GetSizesOf(A <Dictionary <string, int> > .Ignored)).Returns( new[] { ("t", new Size(50, 50)), ("y", new Size(50, 50)) }
public void Perform() { var text = textReader.Read(inputFile); var textFiltered = wordsFilter.FilterWords(text); var wordsCount = wordsCounter.CountWords(textFiltered); var sizes = wordsToSizesConverter.GetSizesOf(wordsCount).ToArray(); sizes = sizes.OrderByDescending(x => x.Item2.Width).ThenBy(x => x.Item2.Height).ToArray(); CCL.Center = new Point(CCL.Center.X, CCL.Center.Y - sizes[0].Item2.Height); for (var i = 0; i < sizes.Length; i++) { CCL.PutNextRectangle(sizes[i].Item2); } var bitmap = visualiser.DrawRectangles(CCL, sizes); imageSaver.Save(bitmap, outputFile); }