()
| 106 | } |
| 107 | |
| 108 | func (s *UserSuite) Test_DeleteUserByID_LastAdmin_Expect400() { |
| 109 | s.db.CreateUser(&model.User{ |
| 110 | ID: 7, |
| 111 | Name: "admin", |
| 112 | Admin: true, |
| 113 | }) |
| 114 | s.ctx.Params = gin.Params{{Key: "id", Value: "7"}} |
| 115 | |
| 116 | s.a.DeleteUserByID(s.ctx) |
| 117 | |
| 118 | assert.Equal(s.T(), 400, s.recorder.Code) |
| 119 | } |
| 120 | |
| 121 | func (s *UserSuite) Test_DeleteUserByID_InvalidID() { |
| 122 | s.ctx.Params = gin.Params{{Key: "id", Value: "abc"}} |
nothing calls this directly
no test coverage detected