Spun off from #806.
Currently, an unconfigured method with a return value will return a Dummy of the appropriate type when called.
However, as soon as we start building a rule (for example, when we add an Invokes behaviour to the method), we create a rule that will return the "default value" for the type, as we can see in BuildableCallRule's constructor. GetDefaultValue returns null for a reference type or an instance for a value type.
And then if we decide to have the method DoesNothing, the rule is modified so that it will not set the return value at all (and this is the cause of the bug that @thomaslevesque found).
I think that all three situations should use the "unconfigured behaviour" and return a Dummy (or nothing for a void of course).
Spun off from #806.
Currently, an unconfigured method with a return value will return a
Dummyof the appropriate type when called.However, as soon as we start building a rule (for example, when we add an
Invokesbehaviour to the method), we create a rule that will return the "default value" for the type, as we can see in BuildableCallRule's constructor.GetDefaultValuereturns null for a reference type or an instance for a value type.And then if we decide to have the method
DoesNothing, the rule is modified so that it will not set the return value at all (and this is the cause of the bug that @thomaslevesque found).I think that all three situations should use the "unconfigured behaviour" and return a
Dummy(or nothing for a void of course).