public async Task Predicate_NoMatch() { var message = new Messages.Message(); message.Text = "hello world"; var matcher = new PredicateMatcher(msg => msg.Text == "test"); var matches = await matcher.GetMatches(message); Assert.Null(matches); }
public async Task Predicate_Match() { var message = new Messages.Message(); message.Text = "hello world"; var matcher = new PredicateMatcher(msg => msg.Text.Equals("HELLO WORLD", StringComparison.OrdinalIgnoreCase)); var matches = await matcher.GetMatches(message); Assert.Equal(1, matches.Length); Assert.Equal(message.Text, matches[0].Text); }