コード例 #1
0
        public void EventWithoutReturnType_DecoratedWithEventActionInterceptionAspectWithNewEventOfOnInvokeThatHasAReturnType_ThrowsAspectTypeMismatchException()
        {
            var Event  = GetEvent("EventWithoutParams");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestInterceptionAspectWithNewEventOfOnInvokeThatHasAReturnType));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #2
0
        public void EventWithoutReturn_DecoratedWithOnActionBoundaryAspectWithNewEventOfOnAddHandlerThatHasMoreThenOneArgument_ThrowsAspectTypeMismatchException()
        {
            var Event  = GetEvent("EventWithoutParams");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestEventInterceptionAspectWithNewEventOfOnAddHandlerThatHasMoreThenOneArgument));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #3
0
        public void ParameterslessEventWithReturnType_DecoratedWithFunctionAspectThatHasAtLeastOneParameter_ThrowsAspectTypeMismatchException()
        {
            var Event  = GetEvent("EventWithoutParamsWithBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #4
0
        public void Event_DecoratedWithFunctionAspectThatHasNoAdvices_ThrowsAdviceNotFoundException()
        {
            var Event  = GetEvent("EventWithStringParamAndBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(NoAdviceAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #5
0
        public void EventWithOneParemeterAndReturnType_DecoratedWithEventFunctionAspectThatHasDifferentSetOfParameters_ThrowsAspectTypeMismatchException()
        {
            var Event  = GetEvent("EventWithStringParamAndBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestAspect4));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #6
0
        public void ParameterslessEventAndNoReturnType_DecoratedWithFunctionAspect_ThrowsAspectAnnotationException()
        {
            var Event  = GetEvent("EventWithoutParams");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #7
0
        public void EventWithAReturnType_DecoratedWithEventActionAspect_ThrowsAspectTypeMismatchException()
        {
            var Event  = GetEvent("EventWithStringParamAndBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(EventAction));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #8
0
        public void EventWithoutReturnType_DecoratedWithEventInterceptionAspectAttribute_ThrowsAspectAnnotationException()
        {
            var Event  = GetEvent("EventWithStringParamAndVoidReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #9
0
        public void EventInterceptionAspectAttribute_GivenAnInterceptionAspectTypeAsAnArgument_ThrowsAspectAnnotationException()
        {
            var Event  = GetEvent("EventWithStringParamAndBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestInterceptionAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #10
0
        public void EventWithOneParameterAndNoReturnType_DecoratedWithOnFunctionInterceptionAspectWithOneAReturnTypeThatIsTheSameUnderlyingTypeAsTheParameterOfTheEvent_ThrowsAspectAnnotationException()
        {
            var Event  = GetEvent("EventWithIntParamAndNoReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestEventFunctionInterceptionAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #11
0
        public void MethodWithOneParameterAndNoReturnType_DecoratedWithOnFunctionInterceptionAspectWithOneAReturnTypeThatIsTheSameUnderlyingTypeAsTheParameterOfTheMethod_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithIntParamAndNoReturnType");
            var aspect = new MethodInterceptionAspectAttribute(typeof(TestFunctionInterceptionAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #12
0
        public void EventWithStringParamAndBoolReturnType_DecoratedWithMatchedEventInterceptionAspectAttribute_ReturnsNoErrorFromValidation()
        {
            var Event  = GetEvent("EventWithStringParamAndBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #13
0
        public void MethodWithoutReturn_DecoratedWithOnActionBoundaryAspectWithNewMethodOfOnExitThatHasMoreThenOneArgument_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithoutParams");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestMethodBounadryAspectAspectWithNewMethodOfOnExitThatHasMoreThenOneArgument));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #14
0
        public void MethodWithOneArgumentAndWithoutReturnType_DecoratedWithFunctionAspectThatHasOneArgumentWhichIsTheSameTypeOfTheMethodsArgument_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithIntParamAndNoReturnType");
            var aspect = new MethodInterceptionAspectAttribute(typeof(TestFunctionInterceptionAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #15
0
        public void MethodWithoutReturnType_DecoratedWithActionInterceptionAspectWithNewMethodOfOnInvokeThatHasMoreThenOneArgument_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithoutParams");
            var aspect = new MethodInterceptionAspectAttribute(typeof(TestInterceptionAspectWithNewMethodOfOnInvokeThatHasMoreThenOneArgument));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #16
0
        public void ParameterslessMethodWithReturnType_DecoratedWithFunctionAspectThatHasAtLeastOneParameter_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithoutParamsWithBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #17
0
        public void Method_DecoratedWithFunctionAspectThatHasNoAdvices_ThrowsAdviceNotFoundException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(NoAdviceAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #18
0
        public void MethodWithoutReturnType_DecoratedWithOnFunctionBoundaryAspectAttribute_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithStringParamAndVoidReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #19
0
        public void ParameterslessMethodAndNoReturnType_DecoratedWithFunctionAspect_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithoutParams");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #20
0
        public void MethodWithAReturnType_DecoratedWithActionAspect_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect6));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #21
0
        public void ParameterlessWithReturnTypeMethod_DecoratedWithMatchedFunctionAspectsWithoutParametersAndReturnType_ReturnsNoErrorFromValidation()
        {
            var method = GetMethod("MethodWithoutParamsWithBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect2));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #22
0
        public void MethodInterceptionAspectAttribute_GivenAnOnMethodBoundaryAspectTypeAsAnArgument_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new MethodInterceptionAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #23
0
        public void MethodWithStringParamAndBoolReturnType_DecoratedWithMatchedOnFunctionBoundaryAspect_ReturnsNoErrorFromValidation()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #24
0
        public void ParameterlessEventWithReturnType_DecoratedWithMatchedFunctionAspectsWithoutParametersAndReturnType_ReturnsNoErrorFromValidation()
        {
            var Event  = GetEvent("EventWithoutParamsWithBoolReturnType");
            var aspect = new EventInterceptionAspectAttribute(typeof(TestAspect2));

            AspectTypeValidator.ValidateEventAspect(aspect, Event);
        }
コード例 #25
0
        public void ParameterslessMethodWithReturnType_DecoratedWithOnActionInterceptionAspectWithOneArgumentThatHasTheSameUnderlyingTypeAsTheReturnTypeOfTheMethod_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithoutParamsWithBoolReturnType");
            var aspect = new MethodInterceptionAspectAttribute(typeof(TestAspect5));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #26
0
        public void MethodWithOneParemeterAndReturnType_DecoratedWithFunctionAspectThatHasDifferentSetOfParameters_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect4));

            AspectTypeValidator.ValidateMethodAspect(aspect, method);
        }
コード例 #27
0
        public void SetPropertyOfContractType_DerivedByAnInterfaceTypeThatExposesBothPropertiesAndDecoratedWithMatchedPropertyInterceptionAspect_ThrowsPropertyAccessorsMismatchException()
        {
            var contractProperty = GetProperty("SetAccessorProperty");
            var implProperty     = GetProperty("SetAccessorProperty", typeof(ISubjectExtended));
            var aspect           = new PropertyInterceptionAspectAttribute(typeof(PropertyInterceptionAspect));

            AspectTypeValidator.ValidatePropertyAspect(aspect, contractProperty, implProperty);
        }
コード例 #28
0
        public void GetProperty_DecoratedWithMatchedPropertyInterceptionAspectThatHasNoAdvices_ThrowsAdviceNotFoundException()
        {
            var contractProperty = GetProperty("GetAccessorProperty");
            var implProperty     = GetProperty("GetAccessorProperty", typeof(Subject));
            var aspect           = new PropertyInterceptionAspectAttribute(typeof(NoAdviceAspect));

            AspectTypeValidator.ValidatePropertyAspect(aspect, contractProperty, implProperty);
        }
コード例 #29
0
        public void GetProperty_DecoratedWithMatchedPropertyInterceptionAspectWithNewMethodOfOnSetValueThatHasMoreThenOneArgument_ThrowsAspectTypeMismatchException()
        {
            var contractProperty = GetProperty("GetAccessorProperty");
            var implProperty     = GetProperty("GetAccessorProperty", typeof(Subject));
            var aspect           = new PropertyInterceptionAspectAttribute(typeof(PropertyInterceptionAspectWithNewMethodOfOnSetValueThatHasMoreThenOneArgument));

            AspectTypeValidator.ValidatePropertyAspect(aspect, contractProperty, implProperty);
        }
コード例 #30
0
        public void SetPropertyOfContractType_ImplementedByATypeThatExposesBothPropertiesAndDecoratedWithMatchedPropertyInterceptionAspect_ReturnsNoErrorFromValidation()
        {
            var contractProperty = GetProperty("SetAccessorProperty");
            var implProperty     = GetProperty("SetAccessorProperty", typeof(Subject));
            var aspect           = new PropertyInterceptionAspectAttribute(typeof(PropertyInterceptionAspect));

            AspectTypeValidator.ValidatePropertyAspect(aspect, contractProperty, implProperty);
        }