I have the following method signature in my iterface:
void SetItem(ref AddressItem item);
I do a parameter constraint like this:
IAddAddressForm form = Substitute.For<IAddAddressForm>();
AddressItem item = null;
form.SetItem(Arg.Is(item));
But that fails because of the ref. If I take the ref out then it works fine. But I need to pass by reference here.
Any ideas how to get this?
Side Note: My ultimate goal is to throw an exception in SetItem if the passed in value is null. If you can help with that then you get extra points!