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
無理にTable Driven Testにせずに順にステップを踏む mockdataは使わずにテスト内で作ったデータを挿入する externalのmockはgomockを使い必要であれば動作を定義する
func TestGetContests(t *testing.T) { t.Parallel() db := SetupTestGormDB(t) ctrl := gomock.NewController(t) repo := NewContestRepository(db, mock_external.NewMockPortalAPI(ctrl)) contest1, err := repo.CreateContest(context.Background(), randomContestArgs()) assert.NoError(t, err) contest2, err := repo.CreateContest(context.Background(), randomContestArgs()) assert.NoError(t, err) t.Run("success", func(t *testing.T) { actualContests, err := repo.GetContests(context.Background()) assert.NoError(t, err) expectedContests := []*domain.Contest{&contest1.Contest, &contest2.Contest} assert.ElementsMatch(t, expectedContests, actualContests) }) // t.Run("... }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
無理にTable Driven Testにせずに順にステップを踏む
mockdataは使わずにテスト内で作ったデータを挿入する
externalのmockはgomockを使い必要であれば動作を定義する
The text was updated successfully, but these errors were encountered: