Skip to content

Commit

Permalink
Merge branch 'change_assert_to_require' of github.com:traPtitech/Jomo…
Browse files Browse the repository at this point in the history
…n into change_assert_to_require
  • Loading branch information
Hueter57 committed Dec 31, 2024
2 parents ae60dd1 + 3a79c5d commit a42e004
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions router/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestHandler_GetAdmins(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
GetAdmins(c.Request().Context()).
Expand Down Expand Up @@ -71,6 +72,7 @@ func TestHandler_GetAdmins(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
GetAdmins(c.Request().Context()).
Expand Down Expand Up @@ -101,6 +103,7 @@ func TestHandler_GetAdmins(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
GetAdmins(c.Request().Context()).
Expand Down Expand Up @@ -136,6 +139,7 @@ func TestHandler_PostAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
AddAdmins(c.Request().Context(), admins).
Expand Down Expand Up @@ -168,6 +172,7 @@ func TestHandler_PostAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
AddAdmins(c.Request().Context(), admins).
Expand Down Expand Up @@ -203,6 +208,7 @@ func TestHandler_PostAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
AddAdmins(c.Request().Context(), admins).
Expand Down Expand Up @@ -239,6 +245,7 @@ func TestHandler_DeleteAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
DeleteAdmins(c.Request().Context(), admins).
Expand Down Expand Up @@ -271,6 +278,7 @@ func TestHandler_DeleteAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
DeleteAdmins(c.Request().Context(), admins).
Expand Down Expand Up @@ -300,9 +308,11 @@ func TestHandler_DeleteAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)

err = h.Handlers.DeleteAdmins(c)


assert.Error(t, err)
// FIXME: http.StatusBadRequestの判定をしたい
})
Expand Down Expand Up @@ -331,6 +341,7 @@ func TestHandler_DeleteAdmin(t *testing.T) {

h, err := NewTestHandlers(t, ctrl)
require.NoError(t, err)
require.NoError(t, err)
h.Repository.MockAdminRepository.
EXPECT().
DeleteAdmins(c.Request().Context(), admins).
Expand Down

0 comments on commit a42e004

Please sign in to comment.