Пример #1
0
        public void ReturnsParameterValueFromMostRecentOfMultipleCalls()
        {
            var action = new CollectAction(1);

            action.Invoke(new Invocation(receiver, methodInfo, new object[] {123, "hello"}));
            action.Invoke(new Invocation(receiver, methodInfo, new object[] {456, "goodbye"}));

            Assert.AreEqual("goodbye", action.Parameter);
        }
Пример #2
0
        public void CollectsParameterValueAtSpecifiedIndex()
        {
            var action = new CollectAction(1);

            action.Invoke(new Invocation(receiver, methodInfo, new object[] {123, "hello"}));

            Assert.AreEqual("hello", action.Parameter);
        }