public void ActionWith7Arguments_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_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 OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints(); try { instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(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); } }
public void ActionWith2RefArguments_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices() { var instance = container.Resolve <IActionWith2RefArgumentsComposite>(); var joinPoints = new OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints().Calculate(); try { instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(ref i, ref j); } catch (Exception) { Assert.AreEqual(i, joinPoints); Assert.AreEqual(j, joinPoints); } }
public void FunctionWith1RefArgument_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices() { string result = null; var instance = container.Resolve <IFunctionWith1RefArgumentComposite>(); var joinPoints = new OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints(); var calculated = joinPoints.Calculate(); try { result = instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(ref i); } catch (Exception) { Assert.AreEqual(i, calculated); Assert.IsNull(result); } }
public void FunctionWith2Arguments_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices() { string result = null; var instance = container.Resolve <IFunctionWith2ArgumentsComposite>(); var first = new List <AspectJoinPoints>(); var second = new List <AspectJoinPoints>(); var joinPoints = new OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints(); try { result = instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(first, second); } catch (Exception) { CollectionAssert.AreEqual(first, joinPoints); CollectionAssert.AreEqual(second, joinPoints); Assert.IsNull(result); } }