コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }