public void TestDefaultFilterSettingsAcceptsDefaultGridEvent()
        {
            var filterConfig = new FilterSetting();
            var gridEvent    = new EventGridEvent();

            filterConfig.AcceptsEvent(gridEvent).ShouldBeTrue();
        }
Ejemplo n.º 2
0
        public void TestDefaultFilterSettingsAcceptsDefaultGridEvent()
        {
            var filterConfig = new FilterSetting();
            var gridEvent    = new EventGridEvent();

            Assert.True(filterConfig.AcceptsEvent(gridEvent));
        }
        public void TestAdvancedFilteringFailure(AdvancedFilterSetting filter)
        {
            var filterConfig = new FilterSetting {
                AdvancedFilters = new[] { filter }
            };

            filterConfig.AcceptsEvent(GridEvent).ShouldBeFalse($"{filter.Key} - {filter.OperatorType} - {filter.Value} - {filter.Values.Separate() }");
        }
        public void TestAdvancedFilteringSuccess(AdvancedFilterSetting filter)
        {
            var filterConfig = new FilterSetting {
                AdvancedFilters = new[] { filter }
            };

            Assert.True(filterConfig.AcceptsEvent(GridEvent), $"{filter.Key} - {filter.OperatorType} - {filter.Value} - {filter.Values.Separate() }");
        }
Ejemplo n.º 5
0
        public void TestSubjectFilteringFailure(string beginsWith, string endsWith, bool caseSensitive)
        {
            var filterConfig = new FilterSetting {
                SubjectBeginsWith = beginsWith, SubjectEndsWith = endsWith, IsSubjectCaseSensitive = caseSensitive
            };
            var gridEvent = new EventGridEvent {
                Subject = "This_Is_A_Test_Subject"
            };

            Assert.False(filterConfig.AcceptsEvent(gridEvent));
        }
Ejemplo n.º 6
0
        public void TestEventTypeFilteringFailure(string[] includedEventTypes)
        {
            var filterConfig = new FilterSetting {
                IncludedEventTypes = includedEventTypes
            };
            var gridEvent = new EventGridEvent {
                EventType = "This.is.a.test"
            };

            Assert.False(filterConfig.AcceptsEvent(gridEvent));
        }
        public void TestSubjectFilteringSuccess(string beginsWith, string endsWith, bool caseSensitive)
        {
            var filterConfig = new FilterSetting {
                SubjectBeginsWith = beginsWith, SubjectEndsWith = endsWith, IsSubjectCaseSensitive = caseSensitive
            };
            var gridEvent = new EventGridEvent {
                Subject = "This_Is_A_Test_Subject"
            };

            filterConfig.AcceptsEvent(gridEvent).ShouldBeTrue();
        }
        public void TestEventTypeFilteringSuccess(string[] includedEventTypes)
        {
            var filterConfig = new FilterSetting {
                IncludedEventTypes = includedEventTypes
            };
            var gridEvent = new EventGridEvent {
                EventType = "This.is.a.test"
            };

            filterConfig.AcceptsEvent(gridEvent).ShouldBeTrue();
        }
        public void TestSimpleEventDataFilteringFailure()
        {
            var filterConfig = new FilterSetting
            {
                AdvancedFilters = new[] {
                    new AdvancedFilterSetting {
                        Key = "Data", OperatorType = AdvancedFilterSetting.OperatorTypeEnum.NumberIn, Value = 1
                    }
                }
            };
            var gridEvent = new EventGridEvent {
                Data = 1
            };

            filterConfig.AcceptsEvent(gridEvent).ShouldBeFalse();
        }
        public void TestSimpleEventDataFilteringUsingValueSuccess()
        {
            var filterConfig = new FilterSetting
            {
                AdvancedFilters = new[] {
                    new AdvancedFilterSetting {
                        Key = "Data", OperatorType = AdvancedFilterSetting.OperatorTypeEnum.NumberGreaterThanOrEquals, Value = 1
                    },
                    new AdvancedFilterSetting {
                        Key = "Data", OperatorType = AdvancedFilterSetting.OperatorTypeEnum.NumberLessThanOrEquals, Value = 1
                    }
                }
            };
            var gridEvent = new EventGridEvent {
                Data = 1
            };

            filterConfig.AcceptsEvent(gridEvent).ShouldBeTrue();
        }