We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DIを利用してる部分はその部分が巧みに利用できていると嬉しい。 下記テスト対象のプログラム
pkg/config/user/config.go
server/user/connector.go
server/user/server.go
service/user/service.go
server.goはやり方を考えないと行けない気がする。
server.go
The text was updated successfully, but these errors were encountered:
GoMockが非常に便利だったので、それを利用したServiceとMockRepositoryのテスト方法や基本的な使い方をwikiに記載しておくこと
% mockgen -source repository/repository.go > service_mock.go
でinterfaceのみ定義したrepository.goからmock_repositoryパッケージのMockソースコードを吐き出した。
interface
repository.go
mock_repository
Sorry, something went wrong.
server/user/server.goは外部からInjectionができるわけでもないので、テストは実際に動かしてE2Eテストをすることが良いと思う。実質こいつmain.goから切り離しただけなので。
main.go
smockoro
No branches or pull requests
DIを利用してる部分はその部分が巧みに利用できていると嬉しい。
下記テスト対象のプログラム
pkg/config/user/config.go
server/user/connector.go
server/user/server.go
service/user/service.go
server.go
はやり方を考えないと行けない気がする。The text was updated successfully, but these errors were encountered: