(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestAssertion_HandlerPanics(t *testing.T) { |
| 145 | t.Run("success, nil Formatter", func(t *testing.T) { |
| 146 | handler := &DefaultAssertionHandler{ |
| 147 | Formatter: nil, |
| 148 | Reporter: newMockReporter(t), |
| 149 | Logger: newMockLogger(t), |
| 150 | } |
| 151 | |
| 152 | assert.Panics(t, func() { |
| 153 | handler.Success(&AssertionContext{ |
| 154 | TestName: t.Name(), |
| 155 | }) |
| 156 | }) |
| 157 | }) |
| 158 | |
| 159 | t.Run("failure, nil Formatter", func(t *testing.T) { |
| 160 | handler := &DefaultAssertionHandler{ |
| 161 | Formatter: nil, |
| 162 | Reporter: newMockReporter(t), |
| 163 | Logger: newMockLogger(t), |
| 164 | } |
| 165 | |
| 166 | assert.Panics(t, func() { |
| 167 | handler.Failure( |
| 168 | &AssertionContext{ |
| 169 | TestName: t.Name(), |
| 170 | }, |
| 171 | &AssertionFailure{ |
| 172 | Type: AssertValid, |
| 173 | Severity: SeverityError, |
| 174 | }) |
| 175 | }) |
| 176 | }) |
| 177 | |
| 178 | t.Run("failure, nil Reporter", func(t *testing.T) { |
| 179 | handler := &DefaultAssertionHandler{ |
| 180 | Formatter: newMockFormatter(t), |
| 181 | Reporter: nil, |
| 182 | Logger: newMockLogger(t), |
| 183 | } |
| 184 | |
| 185 | assert.Panics(t, func() { |
| 186 | handler.Failure( |
| 187 | &AssertionContext{ |
| 188 | TestName: t.Name(), |
| 189 | }, |
| 190 | &AssertionFailure{ |
| 191 | Type: AssertValid, |
| 192 | Severity: SeverityError, |
| 193 | }) |
| 194 | }) |
| 195 | }) |
| 196 | } |
| 197 | |
| 198 | func TestAssertion_ValidateTraits(t *testing.T) { |
| 199 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…