SetupSuite sets up the suite by creating a map of all methods on querier and setting their count to 0.
()
| 68 | // SetupSuite sets up the suite by creating a map of all methods on querier |
| 69 | // and setting their count to 0. |
| 70 | func (s *MethodTestSuite) SetupSuite() { |
| 71 | ctrl := gomock.NewController(s.T()) |
| 72 | mockStore := dbmock.NewMockStore(ctrl) |
| 73 | // We intentionally set no expectations apart from this. |
| 74 | mockStore.EXPECT().Wrappers().Return([]string{}).AnyTimes() |
| 75 | az := dbauthz.New(mockStore, nil, slog.Make(), coderdtest.AccessControlStorePointer()) |
| 76 | // Take the underlying type of the interface. |
| 77 | azt := reflect.TypeOf(az) |
| 78 | require.Greater(s.T(), azt.NumMethod(), 0, "no methods found on querier") |
| 79 | s.methodAccounting = make(map[string]int) |
| 80 | for i := 0; i < azt.NumMethod(); i++ { |
| 81 | method := azt.Method(i) |
| 82 | if _, ok := skipMethods[method.Name]; ok { |
| 83 | // We can't use s.T().Skip as this will skip the entire suite. |
| 84 | s.T().Logf("Skipping method %q: %s", method.Name, skipMethods[method.Name]) |
| 85 | continue |
| 86 | } |
| 87 | s.methodAccounting[method.Name] = 0 |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | // TearDownSuite asserts that all methods were called at least once. |
| 92 | func (s *MethodTestSuite) TearDownSuite() { |
nothing calls this directly
no test coverage detected