Exemplo n.º 1
0
        public void Test_Next_To_Special_Characters()
        {
            var             employee       = new Employee("Joe", "Brown", "Smith");
            string          input          = "Hello !Joe Smith@ #Joe B Smith$, ^joe b. smith&, *joe brown SMITH(, )joey smith-=.";
            IPatternChecker patternChecker = new NamePatternChecker();
            int             count          = patternChecker.MatchPatterns(employee, input);

            Assert.AreEqual(4, count);
        }
Exemplo n.º 2
0
        public void Test_First_And_Last()
        {
            var             employee       = new Employee("Joe", "Brown", "Smith");
            string          input          = "Hello Joe Smith, how are you.?";
            IPatternChecker patternChecker = new NamePatternChecker();
            int             count          = patternChecker.MatchPatterns(employee, input);

            Assert.AreEqual(1, count);
        }
Exemplo n.º 3
0
        public void Test_First_And_Last_With_SingleQuote()
        {
            var             employee       = new Employee("Jim", "Mason", "O'Malley");
            string          input          = "I'll run over to Jim M. O'Malley next.";
            IPatternChecker patternChecker = new NamePatternChecker();
            int             count          = patternChecker.MatchPatterns(employee, input);

            Assert.AreEqual(1, count);
        }
Exemplo n.º 4
0
        public void Test_All_Cases()
        {
            var             employee       = new Employee("Joe", "Brown", "Smith");
            string          input          = "Hello Joe Smith, Joe B Smith, joe b. smith, joe brown SMITH, joey smith.";
            IPatternChecker patternChecker = new NamePatternChecker();
            int             count          = patternChecker.MatchPatterns(employee, input);

            Assert.AreEqual(4, count);
        }
Exemplo n.º 5
0
        public void Test_First_And_Last_With_Hyphen()
        {
            var             employee       = new Employee("Ryan", "David", "O-Connor");
            string          input          = "Ryan O-Connor, long time no see.";
            IPatternChecker patternChecker = new NamePatternChecker();
            int             count          = patternChecker.MatchPatterns(employee, input);

            Assert.AreEqual(1, count);
        }