Beispiel #1
0
        public void CheckTypeReturn()
        {
            var    blib  = new testenginterview.bigramlib();
            string empty = "";

            Assert.IsInstanceOfType(blib.biGrams(empty), typeof(List <string>));
        }
Beispiel #2
0
        public void IgnoreOneWord()
        {
            var    blib    = new testenginterview.bigramlib();
            string oneword = "the";

            Assert.AreEqual(blib.biGrams(oneword).Count, 0);
        }
Beispiel #3
0
        public void IgnoreGarbage()
        {
            var    blib    = new testenginterview.bigramlib();
            string garbage = "~!@#$%^&*()_+{}|[]\\:\";'<>?,./ ~!@#$%^&*()_+{}|[]\\:\";'<>?,./";

            Assert.AreEqual(blib.biGrams(garbage).Count, 0);
        }
Beispiel #4
0
        public void IgnoreEmpty()
        {
            var    blib  = new testenginterview.bigramlib();
            string empty = "";

            Assert.AreEqual(blib.biGrams(empty).Count, 0);
        }
Beispiel #5
0
        public void CountIncludingDuplicates()
        {
            var blib = new testenginterview.bigramlib();

            Assert.AreEqual(blib.biGrams("“The quick brown fox and the quick blue hare.”").Count, 8);
        }