public void ProcessWords(string[] words, int exp) { var wordProcessor = new WordsProcessor(); var count = wordProcessor.GetVowelsCount(words.ToList()); Assert.Equal(exp, count); }
public void WordProcessorTests_EmptyList() { int maxWordLength = 6; List <string> words = new List <string>(); var processor = new WordsProcessor(maxWordLength, words); IEnumerable <Tuple <string, string> > gluedWords = processor.GenerateWordCombinations(); Assert.True(gluedWords.Count() == 0); }
static void Main(string[] args) { IInputDataReader reader = ServiceProviderManager.GetServiceProvider().GetService <IInputDataReader>(); IEnumerable <string> inputData = reader.RetrieveInputData().Distinct(); var processor = new WordsProcessor(6, inputData); IEnumerable <Tuple <string, string> > res = processor.GenerateWordCombinations(); foreach (var r in res) { Console.WriteLine(ConsoleViewTemplate.Apply(r.Item1, r.Item2)); } }
public void WordProcessorTests_BasicCase(int maxWordLength, int expected) { List <string> words = new List <string>() { { "bas" }, { "alt" }, { "basalt" }, { "b" }, { "asalt" }, { "basal" }, { "t" } }; var processor = new WordsProcessor(maxWordLength, words); IEnumerable <Tuple <string, string> > gluedWords = processor.GenerateWordCombinations(); int result = gluedWords.Count(); Assert.Equal(expected, result); }