Пример #1
0
        public void MethodWithOnMethodBoundaryAspectAttribute_DecoratedWithMatchedFunctionAspects_ReturnsNoErrorFromValidation()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }
Пример #2
0
        public void MethodInterceptionAspectAttribute_GivenAnOnMethodBoundaryAspectTypeAsAnArgument_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new MethodInterceptionAspectAttribute(typeof(TestAspect));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }
Пример #3
0
        public void MethodWithOnMethodBoundaryAspectAttribute_DecoratedWithFunctionAspectThatHasNoAdvices_ThrowsAdviceNotFoundException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(NoAdviceAspect));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }
Пример #4
0
        public void ParameterslessMethodWithOnMethodBoundaryAspectAttribute_DecoratedWithFunctionAspectThatHasAtLeastOneParameter_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithoutParamsWithReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }
Пример #5
0
        public void ParameterslessMethodOnNoReturnTypeWithOnMethodBoundaryAspectAttribute_DecoratedWithFunctionAspect_ThrowsAspectAnnotationException()
        {
            var method = GetMethod("MethodWithoutParams");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }
Пример #6
0
        public void MethodWithOnMethodBoundaryAspectAttribute_DecoratedWithFunctionAspectThatHasDifferentSetOfParameters_ThrowsAspectTypeMismatchException()
        {
            var method = GetMethod("MethodWithStringParamAndBoolReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect4));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }
Пример #7
0
        public void ParameterlessWithReturnTypeMethodWithOnMethodBoundaryAspectAttribute_DecoratedWithMatchedFunctionAspectsWithoutParametersAndReturnType_ReturnsNoErrorFromValidation()
        {
            var method = GetMethod("MethodWithoutParamsWithReturnType");
            var aspect = new OnMethodBoundaryAspectAttribute(typeof(TestAspect2));

            AspectTypeMethodValidator.ValidateMethodAspect(aspect, method);
        }