(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestHTTPStatusCode(t *testing.T) { |
| 116 | t.Parallel() |
| 117 | |
| 118 | assert := New(t) |
| 119 | |
| 120 | mockT1 := new(testing.T) |
| 121 | assert.Equal(HTTPStatusCode(mockT1, httpOK, "GET", "/", nil, http.StatusSwitchingProtocols), false) |
| 122 | assert.True(mockT1.Failed()) |
| 123 | |
| 124 | mockT2 := new(testing.T) |
| 125 | assert.Equal(HTTPStatusCode(mockT2, httpRedirect, "GET", "/", nil, http.StatusSwitchingProtocols), false) |
| 126 | assert.True(mockT2.Failed()) |
| 127 | |
| 128 | mockT3 := new(mockTestingT) |
| 129 | assert.Equal(HTTPStatusCode( |
| 130 | mockT3, httpError, "GET", "/", nil, http.StatusSwitchingProtocols, |
| 131 | "Expected the status code to be %d", http.StatusSwitchingProtocols, |
| 132 | ), false) |
| 133 | assert.True(mockT3.Failed()) |
| 134 | assert.Contains(mockT3.errorString(), "Expected the status code to be 101") |
| 135 | |
| 136 | mockT4 := new(testing.T) |
| 137 | assert.Equal(HTTPStatusCode(mockT4, httpStatusCode, "GET", "/", nil, http.StatusSwitchingProtocols), true) |
| 138 | assert.False(mockT4.Failed()) |
| 139 | } |
| 140 | |
| 141 | func TestHTTPStatusesWrapper(t *testing.T) { |
| 142 | t.Parallel() |
nothing calls this directly
no test coverage detected