Skip to content

Make all default return values Dummies, even after Invokes or DoesNothing #830

@blairconrad

Description

@blairconrad

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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions