Example #1
0
        public void ReturnTrueIfStringContainsValue()
        {
            var e = new SystemEvent { Message = "Start Message End" };
            var extendedProperties = new FakeExtendedProperties { { "property", "Message" }, { "value", "Message" } };
            var filter = new ContainsFilter(extendedProperties, Enumerable.Empty<ICreateFilterExpressions>());

            Assert.True(Filter.Compile(filter).Invoke(e));
        }
Example #2
0
        public void CanHaveNullProperty()
        {
            var e = new SystemEvent { Message = null };
            var extendedProperties = new FakeExtendedProperties { { "property", "Message" }, { "value", "Message" } };
            var filter = new ContainsFilter(extendedProperties, Enumerable.Empty<ICreateFilterExpressions>());

            Assert.False(Filter.Compile(filter).Invoke(e));
        }
Example #3
0
        public void AlwaysCaseInsensitive()
        {
            var e = new SystemEvent { Message = "Start MESSAGE End" };
            var extendedProperties = new FakeExtendedProperties { { "property", "Message" }, { "value", "Message" } };
            var filter = new ContainsFilter(extendedProperties, Enumerable.Empty<ICreateFilterExpressions>());

            Assert.True(Filter.Compile(filter).Invoke(e));
        }
Example #4
0
        public void NotCompositeExpression()
        {
            var filter = new ContainsFilter(new FakeExtendedProperties(), Enumerable.Empty<ICreateFilterExpressions>());

            Assert.False(filter.CompositeExpression);
        }