public void HasReadableDescription() { int index = 1; object value = new NamedObject("value"); var action = new SetIndexedParameterAction(index, value); AssertDescription.IsEqual(action, "set arg 1=<value>"); }
public void SetsIndexedParameterOnInvocation() { var receiver = new object(); var methodInfo = new MethodInfoStub("method", new ParameterInfoStub("p1", ParameterAttributes.In), new ParameterInfoStub("p2", ParameterAttributes.Out)); int index = 1; var value = new object(); var invocation = new Invocation(receiver, methodInfo, new object[] {null, null}); var action = new SetIndexedParameterAction(index, value); action.Invoke(invocation); Assert.AreSame(value, invocation.Parameters[index], "set value"); }