cweill / gotests

Automatically generate Go test boilerplate from your source code.
Apache License 2.0
4.91k stars 345 forks source link

Support to automatically generate mock code #132

Open ivanxwwu opened 4 years ago

ivanxwwu commented 4 years ago

Since most of the time when we write cases we are writing mock data, I want to know if there are plans to integrate mock tools under gotests, such as gomonkey, convey, etc. When we use gotests to generate cases, we also generate mock sample code together. I am also doing secondary development based on your gotests tool to achieve this function.

cweill commented 3 years ago

When you have a PR that adds similar functionality, let me know. I'll be happy to have a look. Feel free to add more details here if you have suggestions. Currently there are no plans to add mock support as the use of mocks heavily depends on whether the code author prefers mocks or fakes/dependency-injection.

See https://martinfowler.com/articles/mocksArentStubs.html