示例#1
0
        public void Question1Test()
        {
            var lines           = "raw";
            var search          = "pat2";
            var SEARCH_OPTION   = "1";
            var expectedMatches = 3;

            string[] args         = { lines, search, SEARCH_OPTION, programChoice, delay };
            var      stringSearch = new StrSearch();
            var      totalMatches = stringSearch.GetTotalParallelSearchMatches(args);

            Assert.AreEqual(expectedMatches, totalMatches);
        }
示例#2
0
        public void Question7Test()
        {
            var lines           = "src";
            var search          = "pat4";
            var SEARCH_OPTION   = "2";
            var expectedMatches = 127;

            string[] args         = { lines, search, SEARCH_OPTION, programChoice, delay };
            var      stringSearch = new StrSearch();
            var      totalMatches = stringSearch.GetTotalSequentialSearchMatches(args);

            Assert.AreEqual(expectedMatches, totalMatches);
        }
示例#3
0
        public void Question6Test()
        {
            var lines           = "src";
            var search          = "pat3";
            var SEARCH_OPTION   = "2";
            var expectedMatches = 271;

            string[] args         = { lines, search, SEARCH_OPTION, programChoice, delay, threads };
            var      stringSearch = new StrSearch();
            var      totalMatches = stringSearch.GetTotalThreadedSearchMatches(args);

            Assert.AreEqual(expectedMatches, totalMatches);
        }