Пример #1
0
        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());
        }
Пример #2
0
        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());
        }
Пример #3
0
        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());
        }