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_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); }
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_stringNull() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Throws<ArgumentNullException>(() => obj.MatchEnding(null)); }
public void op_MatchEnding_stringEmpty() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Null(obj.MatchEnding(string.Empty)); }
public void op_MatchEnding_stringNull() { var obj = new LexicalItem(NormalityComparer.Ordinal, "Example"); Assert.Throws <ArgumentNullException>(() => obj.MatchEnding(null)); }