public void ActionWith7Arguments_AnnotatedWithMultipleOnMethodBoundaryAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IActionWith7ArgumentsComposite>();
            var first      = new List <AspectJoinPoints>();
            var second     = new List <AspectJoinPoints>();
            var third      = new List <AspectJoinPoints>();
            var fourth     = new List <AspectJoinPoints>();
            var fifth      = new List <AspectJoinPoints>();
            var sixth      = new List <AspectJoinPoints>();
            var seventh    = new List <AspectJoinPoints>();
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints();

            instance.MultipleOnMethodBoundaryAspects(first, second, third, fourth, fifth, sixth, seventh);

            CollectionAssert.AreEqual(first, joinPoints);
            CollectionAssert.AreEqual(second, joinPoints);
            CollectionAssert.AreEqual(third, joinPoints);
            CollectionAssert.AreEqual(fourth, joinPoints);
            CollectionAssert.AreEqual(fifth, joinPoints);
            CollectionAssert.AreEqual(sixth, joinPoints);
            CollectionAssert.AreEqual(seventh, joinPoints);
            CollectionAssert.DoesNotContain(first, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(second, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(third, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(fourth, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(fifth, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(sixth, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(seventh, AspectJoinPoints.OnException);
        }
        public void ActionWith2Arguments_AnnotatedWithOnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithDefaultFlowBehaviour_ThrowsException()
        {
            var instance   = container.Resolve <IActionWith2ArgumentsComposite>();
            var first      = new List <AspectJoinPoints>();
            var second     = new List <AspectJoinPoints>();
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints();

            instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImpl(first, second);
        }
        public void FunctionWith1RefArgument_AnnotatedWithMultipleOnMethodBoundaryAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IFunctionWith1RefArgumentComposite>();
            var result     = instance.MultipleOnMethodBoundaryAspects(ref i);
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints();
            var calculated = joinPoints.Calculate();

            Assert.AreEqual(i, calculated);
            Assert.AreEqual(result, new ReturnValueAspectOrderedJoinPoints(joinPoints).ToString());
        }
예제 #4
0
        public void ActionWith2RefArguments_AnnotatedWithMultipleOnMethodBoundaryAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IActionWith2RefArgumentsComposite>();
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints().Calculate();

            instance.MultipleOnMethodBoundaryAspects(ref i, ref j);

            Assert.AreEqual(i, joinPoints);
            Assert.AreEqual(j, joinPoints);
        }
        public void FunctionWith1Argument_AnnotatedWithMultipleOnMethodBoundaryAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IFunctionWith1ArgumentComposite>();
            var list       = new List <AspectJoinPoints>();
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints();
            var result     = instance.MultipleOnMethodBoundaryAspects(list);

            CollectionAssert.AreEqual(list, joinPoints);
            CollectionAssert.DoesNotContain(list, AspectJoinPoints.OnException);
            Assert.AreEqual(result, new ReturnValueAspectOrderedJoinPoints(joinPoints).ToString());
        }
예제 #6
0
        public void FunctionWith8Arguments_AnnotatedWithOnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithDefaultFlowBehaviour_ThrowsException()
        {
            var instance   = container.Resolve <IFunctionWith8ArgumentsComposite>();
            var first      = new List <AspectJoinPoints>();
            var second     = new List <AspectJoinPoints>();
            var third      = new List <AspectJoinPoints>();
            var fourth     = new List <AspectJoinPoints>();
            var fifth      = new List <AspectJoinPoints>();
            var sixth      = new List <AspectJoinPoints>();
            var seventh    = new List <AspectJoinPoints>();
            var eighth     = new List <AspectJoinPoints>();
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints();

            instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImpl(first, second, third, fourth, fifth, sixth, seventh, eighth);
        }
예제 #7
0
        public void FunctionWith4Arguments_AnnotatedWithMultipleOnMethodBoundaryAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IFunctionWith4ArgumentsComposite>();
            var first      = new List <AspectJoinPoints>();
            var second     = new List <AspectJoinPoints>();
            var third      = new List <AspectJoinPoints>();
            var fourth     = new List <AspectJoinPoints>();
            var joinPoints = new MultipleOnMethodBoundaryAspectOrderedJoinPoints();
            var result     = instance.MultipleOnMethodBoundaryAspects(first, second, third, fourth);

            CollectionAssert.AreEqual(first, joinPoints);
            CollectionAssert.AreEqual(second, joinPoints);
            CollectionAssert.AreEqual(third, joinPoints);
            CollectionAssert.AreEqual(fourth, joinPoints);
            CollectionAssert.DoesNotContain(first, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(second, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(third, AspectJoinPoints.OnException);
            CollectionAssert.DoesNotContain(fourth, AspectJoinPoints.OnException);
            Assert.AreEqual(result, new ReturnValueAspectOrderedJoinPoints(joinPoints).ToString());
        }