Ejemplo n.º 1
0
        public void WritetofileTest()
        {
            Dictionary <string, int> dc = new Dictionary <string, int>();
            port   pt   = new port();
            string prep = null;
            int    text = 0;

            prep = pt.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");
            text = pt.Tolower();
            int line = 0;

            line = pt.Wordlinenum();
            int wordcount = 0;

            wordcount = pt.Characternum();
            int wordnum = 0;

            wordnum = pt.Wordnum();
            int wordf = 0;

            wordf = pt.Wordfrequency();
            dc    = pt.Getsort();
            int wf = 0;

            wf = pt.Writetofile(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt", @"D:\VS_practice\wordCount\wordCount\bin\Debug\output.txt");
            Assert.AreEqual(1, wf);
        }
Ejemplo n.º 2
0
        public void PrepTest()
        {
            port   prep     = new port();
            string getchara = prep.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");

            Assert.IsNotNull(getchara);
        }
Ejemplo n.º 3
0
        public void TolowerTest()
        {
            port   pt   = new port();
            string prep = null;
            int    text = 0;

            prep = pt.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");
            text = pt.Tolower();
            Assert.AreEqual(1, text);
        }
Ejemplo n.º 4
0
        public void WritewordTest()
        {
            int          text = 0;
            port         pt   = new port();
            StreamWriter sw   = null;

            sw = new StreamWriter(@"D:\VS_practice\wordCount\wordCount\bin\Debug\output.txt");
            string getchara = pt.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");

            text = pt.Writeword(sw, 3);
            Assert.AreEqual(1, text);
        }
Ejemplo n.º 5
0
        public void WordlinenumTest()
        {
            port   pt   = new port();
            string prep = null;
            int    text = 0;

            prep = pt.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");
            text = pt.Tolower();
            int line = 0;

            line = pt.Wordlinenum();
            Assert.IsTrue(line > 0);
        }
Ejemplo n.º 6
0
        public void WordfrequencyTest()
        {
            port   pt   = new port();
            string prep = null;
            int    text = 0;

            prep = pt.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");
            text = pt.Tolower();
            int line = 0;

            line = pt.Wordlinenum();
            int wordcount = 0;

            wordcount = pt.Characternum();
            int wordnum = 0;

            wordnum = pt.Wordnum();
            int wordf = 0;

            wordf = pt.Wordfrequency();
            Assert.IsTrue(wordf > 0);
        }
Ejemplo n.º 7
0
        public void GetsortTest()
        {
            Dictionary <string, int> dc = new Dictionary <string, int>();
            port   pt   = new port();
            string prep = null;
            int    text = 0;

            prep = pt.Prep(@"D:\VS_practice\wordCount\wordCount\bin\Debug\input.txt");
            text = pt.Tolower();
            int line = 0;

            line = pt.Wordlinenum();
            int wordcount = 0;

            wordcount = pt.Characternum();
            int wordnum = 0;

            wordnum = pt.Wordnum();
            int wordf = 0;

            wordf = pt.Wordfrequency();
            dc    = pt.Getsort();
            Assert.IsNotNull(dc);
        }