public void op_MatchWithin_string_whenExactCanonical() { const string expected = "Example"; var obj = new LexicalItem(NormalityComparer.Ordinal, expected); var actual = obj.MatchWithin(expected); Assert.Equal(expected, actual); }
public void op_MatchWithin_string_whenBeginsWithCanonical() { var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "EXAMPLE"); var expected = new LexicalMatch(obj) { Suffix = "test case" }; var actual = obj.MatchWithin("example test case"); Assert.Equal(expected, actual); }
public void op_MatchWithin_string_whenEndsWithCanonicalTwoWords() { var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "AN EXAMPLE"); var expected = new LexicalMatch(obj) { Prefix = "This is" }; var actual = obj.MatchWithin("This is an example"); Assert.Equal(expected, actual); }
public void op_MatchWithin_string_whenBadSpellingSynonym() { var obj = new LexicalItem(new UnderscoreComparer(), "example"); obj.Synonyms.Add("an example"); var expected = new LexicalMatch(obj) { Prefix = "This is an", Suffix = "test case" }; var actual = obj.MatchWithin("This is an ex0ample test case"); Assert.Equal(expected, actual); }
public void op_MatchWithin_string_whenContainsSynonym() { var obj = new LexicalItem(NormalityComparer.OrdinalIgnoreCase, "ignore"); obj.Synonyms.Add("EXAMPLE"); var expected = new LexicalMatch(obj) { Prefix = "This is an", Suffix = "test case" }; var actual = obj.MatchWithin("This is an example test case"); Assert.Equal(expected, actual); }
public void op_MatchWithin_string_whenCaseDiffersCanonical() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Null(obj.MatchWithin("EXAMPLE")); }
public void op_MatchWithin_stringNull() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Throws<ArgumentNullException>(() => obj.MatchWithin(null)); }
public void op_MatchWithin_stringEmpty() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Null(obj.MatchWithin(string.Empty)); }
public void op_MatchWithin_stringNull() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Throws <ArgumentNullException>(() => obj.MatchWithin(null)); }