Mock generation #46
cjnevin-foxtel
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Generate a different initializer for mock environment providing different default values.
This one extends on from my previous idea around respecting compiler directives.
It would be nice if we could also generate the static mock func for a type.
For example:
Also generates this static function:
Alternatively, we could generate a separate struct called
DependenciesMock
(name +Mock) that stores all of the properties and can be converted to aDependencies
instance. This would reduce test complexity since we wouldn't need to recreate the mocks we want to modify.This would greatly reduce the amount of code I need to write manually for each scenario I want to mock.
Beta Was this translation helpful? Give feedback.
All reactions