public void IntegrationTestNoDir() { var analyzer = new BookAnalyzer(new IntegrationLoaderWithException(new DirectoryNotFoundException()), new IntegrationCounter(), new IntegrationPrime(), "file"); string[] expected = { "could not find directory containing file: file" }; CollectionAssert.AreEqual(expected, analyzer.Analyze().ToArray()); }
public void IntegrationTestException() { var analyzer = new BookAnalyzer(new IntegrationLoaderWithException(new Exception("message")), new IntegrationCounter(), new IntegrationPrime(), "file"); string[] expected = { "message" }; CollectionAssert.AreEqual(expected, analyzer.Analyze().ToArray()); }
public void IntegrationTest() { var analyzer = new BookAnalyzer(new IntegrationLoader(), new IntegrationCounter(), new IntegrationPrime(), ""); string[] expected = { "Word: a, Count: 2, Prime? Yes", "Word: the, Count: 3, Prime? No", "Word: and, Count: 5, Prime? No" }; CollectionAssert.AreEqual(expected, analyzer.Analyze().ToArray()); }