public void should_count_words(string text, int expected) { var counter = new SuperWordsCounter(); using (TextReader reader = new StringReader(text)) { Assert.Equal(expected, counter.Count(reader)); } }
public void should_accept_huge_text_stream() { var counter = new SuperWordsCounter(); const int expectedWordCount = 512 * 1024 * 1024; using (var reader = new HugeTextStream(expectedWordCount)) { Assert.Equal(expectedWordCount, counter.Count(reader)); } }
public void should_throw_if_argument_is_null() { var counter = new SuperWordsCounter(); Assert.Throws <ArgumentNullException>(() => counter.Count(null)); }