(t *testing.T)
| 166 | } |
| 167 | |
| 168 | func TestResponse_Status(t *testing.T) { |
| 169 | reporter := newMockReporter(t) |
| 170 | |
| 171 | cases := []struct { |
| 172 | status int |
| 173 | testStatus int |
| 174 | }{ |
| 175 | {http.StatusOK, http.StatusOK}, |
| 176 | {http.StatusOK, http.StatusNotFound}, |
| 177 | {http.StatusNotFound, http.StatusNotFound}, |
| 178 | {http.StatusNotFound, http.StatusOK}, |
| 179 | } |
| 180 | |
| 181 | for _, tc := range cases { |
| 182 | resp := NewResponse(reporter, &http.Response{ |
| 183 | StatusCode: tc.status, |
| 184 | }) |
| 185 | |
| 186 | resp.Status(tc.testStatus) |
| 187 | |
| 188 | if tc.status == tc.testStatus { |
| 189 | resp.chain.assert(t, success) |
| 190 | } else { |
| 191 | resp.chain.assert(t, failure) |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func TestResponse_StatusRange(t *testing.T) { |
| 197 | reporter := newMockReporter(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…