Exemplo n.º 1
0
        public void RunWithoutFinish_WithEmptyInput()
        {
            var r = new MockReader(new string[] { });
            var p = new MockProcessor();

            var alg = new WordProcessingAlgorithm(r, p);

            alg.RunWithoutFinish();

            CollectionAssert.AreEqual(new List <string>(), p.words);
            Assert.AreEqual(0, p.FinishCalled);
            Assert.AreEqual(0, p.WordsProcessed);
        }
Exemplo n.º 2
0
        public void RunWithoutFinish_WithNonEmptyInput()
        {
            string[] words = new string[] { "No,", "I", "am", "your", "father.", "Nooooo!" };
            var      r     = new MockReader(words);
            var      p     = new MockProcessor();

            var alg = new WordProcessingAlgorithm(r, p);

            alg.RunWithoutFinish();

            CollectionAssert.AreEqual(words, p.words);
            Assert.AreEqual(words.Length, p.WordsProcessed);
            Assert.AreEqual(0, p.FinishCalled);
        }