Exemple #1
0
        public void op_MatchEnding_string_whenExactCanonical()
        {
            const string expected = "Example";
            var          obj      = new LexicalItem(NormalityComparer.Ordinal, expected);
            var          actual   = obj.MatchEnding(expected);

            Assert.Equal(expected, actual);
        }
Exemple #2
0
        public void op_MatchEnding_string_whenEndsWithCanonical()
        {
            var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "EXAMPLE");

            var expected = new LexicalMatch(obj)
            {
                Prefix = "This is an"
            };
            var actual = obj.MatchEnding("This is an example");

            Assert.Equal(expected, actual);
        }
Exemple #3
0
        public void op_MatchEnding_string_whenBadSpellingSynonym()
        {
            var obj = new LexicalItem(new UnderscoreComparer(), "example");

            obj.Synonyms.Add("an example");

            var expected = new LexicalMatch(obj)
            {
                Prefix = "This is"
            };
            var actual = obj.MatchEnding("This is an ex_ample");

            Assert.Equal(expected, actual);
        }
Exemple #4
0
        public void op_MatchEnding_string_whenContainsSynonym()
        {
            var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "ignore");

            obj.Synonyms.Add("EXAMPLE");

            var expected = new LexicalMatch(obj)
            {
                Prefix = "This is an"
            };

            var actual = obj.MatchEnding("This is an example");

            Assert.Equal(expected, actual);
        }
        public void op_MatchEnding_string_whenExactCanonical()
        {
            const string expected = "Example";
            var obj = new LexicalItem(NormalityComparer.Ordinal, expected);
            var actual = obj.MatchEnding(expected);

            Assert.Equal(expected, actual);
        }
        public void op_MatchEnding_string_whenEndsWithCanonical()
        {
            var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "EXAMPLE");

            var expected = new LexicalMatch(obj)
                               {
                                   Prefix = "This is an"
                               };
            var actual = obj.MatchEnding("This is an example");

            Assert.Equal(expected, actual);
        }
        public void op_MatchEnding_string_whenContainsSynonym()
        {
            var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "ignore");
            obj.Synonyms.Add("EXAMPLE");

            var expected = new LexicalMatch(obj)
                               {
                                   Prefix = "This is an"
                               };

            var actual = obj.MatchEnding("This is an example");

            Assert.Equal(expected, actual);
        }
        public void op_MatchEnding_string_whenCaseDiffersCanonical()
        {
            var obj = new LexicalItem(NormalityComparer.Ordinal, "Example");

            Assert.Null(obj.MatchEnding("EXAMPLE"));
        }
        public void op_MatchEnding_string_whenBadSpellingSynonym()
        {
            var obj = new LexicalItem(new UnderscoreComparer(), "example");
            obj.Synonyms.Add("an example");

            var expected = new LexicalMatch(obj)
                               {
                                   Prefix = "This is"
                               };
            var actual = obj.MatchEnding("This is an ex_ample");

            Assert.Equal(expected, actual);
        }
Exemple #10
0
        public void op_MatchEnding_stringNull()
        {
            var obj = new LexicalItem(NormalityComparer.Ordinal, "Example");

            Assert.Throws<ArgumentNullException>(() => obj.MatchEnding(null));
        }
Exemple #11
0
        public void op_MatchEnding_stringEmpty()
        {
            var obj = new LexicalItem(NormalityComparer.Ordinal, "Example");

            Assert.Null(obj.MatchEnding(string.Empty));
        }
Exemple #12
0
        public void op_MatchEnding_string_whenCaseDiffersCanonical()
        {
            var obj = new LexicalItem(NormalityComparer.Ordinal, "Example");

            Assert.Null(obj.MatchEnding("EXAMPLE"));
        }
Exemple #13
0
        public void op_MatchEnding_stringNull()
        {
            var obj = new LexicalItem(NormalityComparer.Ordinal, "Example");

            Assert.Throws <ArgumentNullException>(() => obj.MatchEnding(null));
        }
Exemple #14
0
        public void op_MatchEnding_stringEmpty()
        {
            var obj = new LexicalItem(NormalityComparer.Ordinal, "Example");

            Assert.Null(obj.MatchEnding(string.Empty));
        }