public void ActionWith7Arguments_AnnotatedWithATryFinallyOnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocation_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices()
        {
            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 TryFinallyWithExceptionOnMethodBoundaryAspectOrderedJoinPoints();

            try {
                instance.TryfinallyOnMethodBoundaryAspectThatRaiseAnExceptionInMethodImpl(first, second, third, fourth, fifth, sixth, seventh);
            }
            catch (Exception) {
                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);
            }
        }
Ejemplo n.º 2
0
        public void ActionWith2RefArguments_AnnotatedWithATryFinallyOnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocation_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IActionWith2RefArgumentsComposite>();
            var joinPoints = new TryFinallyWithExceptionOnMethodBoundaryAspectOrderedJoinPoints().Calculate();

            try {
                instance.TryfinallyOnMethodBoundaryAspectThatRaiseAnExceptionInMethodImpl(ref i, ref j);
            }
            catch (Exception) {
                Assert.AreEqual(i, joinPoints);
                Assert.AreEqual(j, joinPoints);
            }
        }
        public void FunctionWith1RefArgument_AnnotatedWithATryFinallyOnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocation_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices()
        {
            string result     = null;
            var    instance   = container.Resolve <IFunctionWith1RefArgumentComposite>();
            var    joinPoints = new TryFinallyWithExceptionOnMethodBoundaryAspectOrderedJoinPoints();
            var    calculated = joinPoints.Calculate();

            try {
                result = instance.TryfinallyOnMethodBoundaryAspectThatRaiseAnExceptionInMethodImpl(ref i);
            }
            catch (Exception) {
                Assert.AreEqual(i, calculated);
                Assert.IsNull(result);
            }
        }
Ejemplo n.º 4
0
        public void FunctionWith2Arguments_AnnotatedWithATryFinallyOnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocation_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices()
        {
            string result     = null;
            var    instance   = container.Resolve <IFunctionWith2ArgumentsComposite>();
            var    first      = new List <AspectJoinPoints>();
            var    second     = new List <AspectJoinPoints>();
            var    joinPoints = new TryFinallyWithExceptionOnMethodBoundaryAspectOrderedJoinPoints();

            try {
                result = instance.TryfinallyOnMethodBoundaryAspectThatRaiseAnExceptionInMethodImpl(first, second);
            }
            catch (Exception) {
                CollectionAssert.AreEqual(first, joinPoints);
                CollectionAssert.AreEqual(second, joinPoints);
                Assert.IsNull(result);
            }
        }