public void Build_ReturnEmptyList_WhenWordsFreqEmpty() { var wordsFrequency = new List <Word>(); var result = sut.Build(wordsFrequency); result.Should().Equal(new List <Tag>()); }
public void Build_ReturnEmptyList_WhenWordsFreqEmpty() { var wordsFrequency = new List <Word>(); var result = sut.Build(wordsFrequency); result.IsSuccess.Should().BeTrue(); result.GetValueOrThrow().Should().Equal(new List <Tag>()); }
public void Perform() { var dialog = new OpenFileDialog { Title = "Select file to build a tag cloud", CheckFileExists = false, Multiselect = false, DefaultExt = "txt", InitialDirectory = @"C:\Users\Public\Documents", Filter = "Текстовый документ |*.txt;*.doc;*.docx" }; var res = dialog.ShowDialog(); if (res != DialogResult.OK) { return; } SettingsForm.For(spiralParams).ShowDialog(); textReader.ReadAllText(dialog.FileName) .Then(text => textHandler.GetHandledWords(text)) .Then(handledWords => tagCloudBuilder.Build(handledWords)) .Then(tagCloud => cloudVisualizer.PrintTagCloud(tagCloud)) .OnFail(message => MessageBox.Show(message)); }
public void Perform() { var result = SettingsForm.For(spiralParams).ShowDialog(); if (result != DialogResult.OK) { return; } var text = textReader.ReadAllText(@"..\..\..\Examples\example.txt"); var handledWords = textHandler.GetHandledWords(text); var tagCloud = tagCloudBuilder.Build(handledWords); cloudVisualizer.PrintTagCloud(tagCloud); }
public void Perform() { var result = SettingsForm.For(spiralParams).ShowDialog(); if (result != DialogResult.OK) { return; } textReader.ReadAllText(@"..\..\..\Examples\example.txt") .Then(text => textHandler.GetHandledWords(text)) .Then(handledWords => tagCloudBuilder.Build(handledWords)) .Then(tagCloud => cloudVisualizer.PrintTagCloud(tagCloud)) .OnFail(message => MessageBox.Show(message)); }