public void CheckIfExceptionIsThrownWhenNoWordsSourceIsSpecified() { // create words loader WordsLoader loader = new WordsLoader(); // skip SetSource... // load the words using the WordsLoader string[] loadedWords = (string[])loader.LoadWords(); }
public void CheckLoadedWordsLengthWhenUsingListSource() { // create words loader WordsLoader loader = new WordsLoader(); // create list words source ListSource listSource = new ListSource(); int listLength = 4; listSource.Words = this.CreateWordsList(listLength); // set loader source loader.SetSource(listSource); // load the words using the WordsLoader string[] loadedWords = (string[])loader.LoadWords(); // do test Assert.AreEqual(listLength, loadedWords.Length); }
private void MenuItemGenerate_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(inputFileName)) { MenuItemOpenFile_Click(null, null); if (string.IsNullOrWhiteSpace(inputFileName)) { return; } } var wordsLoader = new WordsLoader(knownParsers); var words = wordsLoader.LoadWords(inputFileName); var selectedFilters = filtersOptions.Where(fo => fo.IsActive).OrderBy(fo => fo.Priority).Select(fo => fo.Filter).ToArray(); var wordsFilterer = new WordsFilterer(selectedFilters); var filteredWords = wordsFilterer.FilterWords(words); tagsCloud = new TagsCloudGenerator(selectedLayouter, selectedRenderer); tagsCloud.GenerateCloud(filteredWords); UpdateImageControl(); }
public void CheckLoadedWordsWhenUsingListSource() { // create words loader WordsLoader loader = new WordsLoader(); // create list words source ListSource listSource = new ListSource(); int listLength = 4; listSource.Words = this.CreateWordsList(listLength); // set loader source loader.SetSource(listSource); // load the words using the WordsLoader string[] loadedWords = (string[])loader.LoadWords(); // do test for (int i = 0; i < loadedWords.Length; i++) { Assert.AreEqual(loadedWords[i], WordLoadingTests.WORD); } }