예제 #1
0
        public void nullTestingArrays()
        {
            string nonNullString = "abracadabra";
            SuffixArray theSuffixArray = new SuffixArray(nonNullString);
            bool result = theSuffixArray.FindSubstring(null);
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("");
            Assert.AreEqual(false, result);
        }
예제 #2
0
        public void nullTestingArrays()
        {
            string      nonNullString  = "abracadabra";
            SuffixArray theSuffixArray = new SuffixArray(nonNullString);
            bool        result         = theSuffixArray.FindSubstring(null);

            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("");
            Assert.AreEqual(false, result);
        }
예제 #3
0
        public void successfulStringsArrays()
        {
            string testString = "abracadabra";
            SuffixArray theSuffixArray = new SuffixArray(testString);
            bool result = theSuffixArray.FindSubstring("bra");
            Assert.AreEqual(true, result);

            result = theSuffixArray.FindSubstring("ab");
            Assert.AreEqual(true, result);

            result = theSuffixArray.FindSubstring("cada");
            Assert.AreEqual(true, result);

            result = theSuffixArray.FindSubstring("dab");
            Assert.AreEqual(true, result);
        }
예제 #4
0
        public void successfulStringsArrays()
        {
            string      testString     = "abracadabra";
            SuffixArray theSuffixArray = new SuffixArray(testString);
            bool        result         = theSuffixArray.FindSubstring("bra");

            Assert.AreEqual(true, result);

            result = theSuffixArray.FindSubstring("ab");
            Assert.AreEqual(true, result);

            result = theSuffixArray.FindSubstring("cada");
            Assert.AreEqual(true, result);

            result = theSuffixArray.FindSubstring("dab");
            Assert.AreEqual(true, result);
        }
예제 #5
0
        public void failedStringsArrays()
        {
            string      testString     = "abracadabra";
            SuffixArray theSuffixArray = new SuffixArray(testString);
            bool        result;

            result = theSuffixArray.FindSubstring("jason");
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("masud");
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("testing");
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("notastring");
            Assert.AreEqual(false, result);
        }
예제 #6
0
        public void failedStringsArrays()
        {
            string testString = "abracadabra";
            SuffixArray theSuffixArray = new SuffixArray(testString);
            bool result;

            result = theSuffixArray.FindSubstring("jason");
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("masud");
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("testing");
            Assert.AreEqual(false, result);

            result = theSuffixArray.FindSubstring("notastring");
            Assert.AreEqual(false, result);
        }