Пример #1
0
        public void has_changed()
        {
            var filter = new CompositeFilter<string>();
            filter.HasChanged.ShouldBeFalse();
            filter.Includes += x => x == "a";

            filter.HasChanged.ShouldBeTrue();

            filter.ResetChangeTracking();
            filter.HasChanged.ShouldBeFalse();

            filter.Excludes += x => x == "a";
            filter.HasChanged.ShouldBeTrue();

            filter.ResetChangeTracking();
            filter.HasChanged.ShouldBeFalse();
        }
Пример #2
0
        public void has_changed()
        {
            var filter = new CompositeFilter <string>();

            filter.HasChanged.ShouldBeFalse();
            filter.Includes += x => x == "a";

            filter.HasChanged.ShouldBeTrue();

            filter.ResetChangeTracking();
            filter.HasChanged.ShouldBeFalse();

            filter.Excludes += x => x == "a";
            filter.HasChanged.ShouldBeTrue();

            filter.ResetChangeTracking();
            filter.HasChanged.ShouldBeFalse();
        }
Пример #3
0
        public BehaviorMatcher()
        {
            _methodFilters.Excludes += method => method.Method.DeclaringType == typeof(object);
            _methodFilters.Excludes += method => method.Method.DeclaringType == typeof(MarshalByRefObject);
            _methodFilters.Excludes += method => method.Method.DeclaringType == typeof(IDisposable);
            _methodFilters.Excludes += method => method.Method.ContainsGenericParameters;

            _methodFilters.Excludes += method => method.Method.IsSpecialName;

            _methodFilters.ResetChangeTracking();
            _typeFilters.ResetChangeTracking();
        }
Пример #4
0
        public BehaviorMatcher(Func <Type, MethodInfo, ActionCall> actionCallProvider)
        {
            _actionCallProvider      = actionCallProvider;
            _methodFilters.Excludes += method => method.Method.DeclaringType == typeof(object);
            _methodFilters.Excludes += method => method.Method.DeclaringType == typeof(MarshalByRefObject);
            _methodFilters.Excludes += method => method.Method.DeclaringType == typeof(IDisposable);
            _methodFilters.Excludes += method => method.Method.ContainsGenericParameters;

            _methodFilters.Excludes += method => method.Method.IsSpecialName;

            _methodFilters.ResetChangeTracking();
            _typeFilters.ResetChangeTracking();
        }