public void ActionWith4RefArguments_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices() { var instance = container.Resolve<IActionWith4RefArgumentsComposite>(); var joinPoints = new OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints().Calculate(); try { instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(ref i, ref j, ref k, ref l); } catch (Exception) { Assert.AreEqual(i, joinPoints); Assert.AreEqual(j, joinPoints); Assert.AreEqual(k, joinPoints); Assert.AreEqual(l, joinPoints); } }
public void FunctionWith7RefArguments_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices() { string result = null; var instance = container.Resolve<IFunctionWith7RefArgumentsComposite>(); var joinPoints = new OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints(); var calculated = joinPoints.Calculate(); try { result = instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(ref i, ref j, ref k, ref l, ref m, ref n, ref o); } catch (Exception) { Assert.AreEqual(i, calculated); Assert.AreEqual(j, calculated); Assert.AreEqual(k, calculated); Assert.AreEqual(l, calculated); Assert.AreEqual(m, calculated); Assert.AreEqual(n, calculated); Assert.AreEqual(o, calculated); Assert.IsNull(result); } }
public void ActionWith5Arguments_OnMethodBoundaryAspectThatRaisesAnExceptionInMethodInvocationWithoutTryFinally_OmitsTheOnSuccessAdviceAndReturnsTheCorrectSequenceOfAdvices() { var instance = container.Resolve<IActionWith5ArgumentsComposite>(); 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 joinPoints = new OnMethodBoundaryAspectWithExceptionAndWithoutTryFinallyOrderedJoinPoints(); try { instance.OnMethodBoundaryAspectThatRaiseAnExceptionInMethodImplWithoutTryFinally(first, second, third, fourth, fifth); } catch (Exception) { CollectionAssert.AreEqual(first, joinPoints); CollectionAssert.AreEqual(second, joinPoints); CollectionAssert.AreEqual(third, joinPoints); CollectionAssert.AreEqual(fourth, joinPoints); CollectionAssert.AreEqual(fifth, joinPoints); } }
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); } }