コード例 #1
0
        public void FunctionWith1RefArgument_AnnotatedWithMultipleInterceptionAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IFunctionWith1RefArgumentComposite>();
            var result     = instance.MultipleInterceptionAspects(ref i);
            var joinPoints = new MultipleInterceptionAspectOrderedJoinPoints();
            var calculated = joinPoints.Calculate();

            Assert.AreEqual(i, calculated);
            Assert.AreEqual(result, new ReturnValueAspectOrderedJoinPoints(joinPoints).ToString());
        }
コード例 #2
0
        public void ActionWith2RefArguments_AnnotatedWithMultipleInterceptionAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IActionWith2RefArgumentsComposite>();
            var joinPoints = new MultipleInterceptionAspectOrderedJoinPoints().Calculate();

            instance.MultipleInterceptionAspects(ref i, ref j);

            Assert.AreEqual(i, joinPoints);
            Assert.AreEqual(j, joinPoints);
        }
コード例 #3
0
        public void FunctionWith1Argument_AnnotatedWithMultipleInterceptionAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IFunctionWith1ArgumentComposite>();
            var list       = new List <AspectJoinPoints>();
            var joinPoints = new MultipleInterceptionAspectOrderedJoinPoints();
            var result     = instance.MultipleInterceptionAspects(list);

            CollectionAssert.AreEqual(list, joinPoints);
            Assert.AreEqual(result, new ReturnValueAspectOrderedJoinPoints(joinPoints).ToString());
        }
コード例 #4
0
        public void ActionWith2Arguments_AnnotatedWithMultipleInterceptionAspects_ReturnsTheCorrectSequenceOfAdvices()
        {
            var instance   = container.Resolve <IActionWith2ArgumentsComposite>();
            var first      = new List <AspectJoinPoints>();
            var second     = new List <AspectJoinPoints>();
            var joinPoints = new MultipleInterceptionAspectOrderedJoinPoints();

            instance.MultipleInterceptionAspects(first, second);

            CollectionAssert.AreEqual(first, joinPoints);
            CollectionAssert.AreEqual(second, joinPoints);
        }
コード例 #5
0
        public void FunctionWith4Arguments_AnnotatedWithMultipleInterceptionAspects_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 MultipleInterceptionAspectOrderedJoinPoints();
            var result     = instance.MultipleInterceptionAspects(first, second, third, fourth);

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