示例#1
0
文件: UnitTest1.cs 项目: lunakv/Skola
        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);
        }
示例#2
0
文件: UnitTest1.cs 项目: lunakv/Skola
        public void Run_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.Run();

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