(suiteName, testName string)
| 33 | } |
| 34 | |
| 35 | func (s *UserSuite) BeforeTest(suiteName, testName string) { |
| 36 | mode.Set(mode.TestDev) |
| 37 | s.recorder = httptest.NewRecorder() |
| 38 | s.ctx, _ = gin.CreateTestContext(s.recorder) |
| 39 | |
| 40 | s.db = testdb.NewDB(s.T()) |
| 41 | |
| 42 | s.notifier = new(UserChangeNotifier) |
| 43 | s.notifier.OnUserDeleted(func(uint) error { |
| 44 | s.notifiedDelete = true |
| 45 | return nil |
| 46 | }) |
| 47 | s.notifier.OnUserAdded(func(uint) error { |
| 48 | s.notifiedAdd = true |
| 49 | return nil |
| 50 | }) |
| 51 | s.a = &UserAPI{DB: s.db, UserChangeNotifier: s.notifier} |
| 52 | } |
| 53 | |
| 54 | func (s *UserSuite) AfterTest(suiteName, testName string) { |
| 55 | s.db.Close() |
nothing calls this directly
no test coverage detected