Exemplo n.º 1
0
        public void IsMatchingTest_CharacterNotMatch()
        {
            var solution = new _044_WildcardMatching();
            var result = solution.IsMatch("aa", "a");
            Assert.IsFalse(result);

            result = solution.IsMatch("aaa", "aa");
            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        public void IsMatchingTest_Question()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("ab", "?b");
            Assert.IsTrue(result);

            result = solution.IsMatch("ab", "?");
            Assert.IsFalse(result);
        }
Exemplo n.º 3
0
        public void IsMatchingTest_CharacterNotMatch()
        {
            var solution = new _044_WildcardMatching();
            var result   = solution.IsMatch("aa", "a");

            Assert.IsFalse(result);

            result = solution.IsMatch("aaa", "aa");
            Assert.IsFalse(result);
        }
Exemplo n.º 4
0
        public void IsMatchingTest_StringNullOrEmpty()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("", "?");

            Assert.IsFalse(result);

            result = solution.IsMatch("", "?*");
            Assert.IsFalse(result);
        }
Exemplo n.º 5
0
        public void IsMatchingTest_Question()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("ab", "?b");

            Assert.IsTrue(result);

            result = solution.IsMatch("ab", "?");
            Assert.IsFalse(result);
        }
Exemplo n.º 6
0
        public void IsMatchingTest_MultipleStar()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("caab", "c*a*b");
            Assert.IsTrue(result);
        }
Exemplo n.º 7
0
        public void IsMatchingTest_MultipleQuestion()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("aa", "??");
            Assert.IsTrue(result);
        }
Exemplo n.º 8
0
        public void IsMatchingTest_MatcherNullOrEmpty()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("abc", "");
            Assert.IsFalse(result);
        }
Exemplo n.º 9
0
        public void IsMatchingTest_Star_Multiple()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("aa", "*");

            Assert.IsTrue(result);

            result = solution.IsMatch("aaa", "*");
            Assert.IsTrue(result);

            result = solution.IsMatch("aaaa", "b*");
            Assert.IsFalse(result);

            result = solution.IsMatch("abcd", "d*");
            Assert.IsFalse(result);
        }
Exemplo n.º 10
0
        public void IsMatchingTest_StringAndMatcherBothNullOrEmpty()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("", "");

            Assert.IsTrue(result);
        }
Exemplo n.º 11
0
        public void IsMatchingTest_MatcherNullOrEmpty()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("abc", "");

            Assert.IsFalse(result);
        }
Exemplo n.º 12
0
        public void IsMatchingTest_MultipleStar()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("caab", "c*a*b");

            Assert.IsTrue(result);
        }
Exemplo n.º 13
0
        public void IsMatchingTest_Star_Zero()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("ab", "a*b");

            Assert.IsTrue(result);
        }
Exemplo n.º 14
0
        public void IsMatchingTest_MultipleQuestion()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("aa", "??");

            Assert.IsTrue(result);
        }
Exemplo n.º 15
0
        public void IsMatchingTest_QuestionWithStar()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("aa", "?*");
            Assert.IsTrue(result);

            result = solution.IsMatch("ab", "?*");
            Assert.IsTrue(result);

            result = solution.IsMatch("hi", "*?");
            Assert.IsTrue(result);

            result = solution.IsMatch("abcdefg", "?*");
            Assert.IsTrue(result);

            result = solution.IsMatch("bbbba", "?*a");
            Assert.IsTrue(result);

            result = solution.IsMatch("ab", "?*c");
            Assert.IsFalse(result);
        }
Exemplo n.º 16
0
        public void IsMatchingTest_QuestionWithStar()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("aa", "?*");

            Assert.IsTrue(result);

            result = solution.IsMatch("ab", "?*");
            Assert.IsTrue(result);

            result = solution.IsMatch("hi", "*?");
            Assert.IsTrue(result);

            result = solution.IsMatch("abcdefg", "?*");
            Assert.IsTrue(result);

            result = solution.IsMatch("bbbba", "?*a");
            Assert.IsTrue(result);

            result = solution.IsMatch("ab", "?*c");
            Assert.IsFalse(result);
        }
Exemplo n.º 17
0
        public void IsMatchingTest_Star_Zero()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("ab", "a*b");
            Assert.IsTrue(result);
        }
Exemplo n.º 18
0
        public void IsMatchingTest_Star_Multiple()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("aa", "*");
            Assert.IsTrue(result);

            result = solution.IsMatch("aaa", "*");
            Assert.IsTrue(result);

            result = solution.IsMatch("aaaa", "b*");
            Assert.IsFalse(result);

            result = solution.IsMatch("abcd", "d*");
            Assert.IsFalse(result);
        }
Exemplo n.º 19
0
        public void IsMatchingTest_StringNullOrEmpty()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("", "?");
            Assert.IsFalse(result);

            result = solution.IsMatch("", "?*");
            Assert.IsFalse(result);
        }
Exemplo n.º 20
0
        public void IsMatchingTest_StringAndMatcherBothNullOrEmpty()
        {
            var solution = new _044_WildcardMatching();

            var result = solution.IsMatch("", "");
            Assert.IsTrue(result);
        }