(t *testing.T)
| 274 | } |
| 275 | |
| 276 | func Test_verifySuccesses(t *testing.T) { |
| 277 | type args struct { |
| 278 | statuses []*common.TSStatus |
| 279 | } |
| 280 | var internalServerError = "InternalServerError" |
| 281 | var success = "Success" |
| 282 | var redirectionRecommend = "RedirectionRecommend" |
| 283 | tests := []struct { |
| 284 | name string |
| 285 | args args |
| 286 | wantErr bool |
| 287 | }{ |
| 288 | { |
| 289 | name: "InternalServerError", |
| 290 | args: args{ |
| 291 | statuses: []*common.TSStatus{ |
| 292 | { |
| 293 | Code: InternalServerError, |
| 294 | Message: &internalServerError, |
| 295 | SubStatus: []*common.TSStatus{}, |
| 296 | }, |
| 297 | }, |
| 298 | }, |
| 299 | wantErr: true, |
| 300 | }, { |
| 301 | name: "SuccessStatus", |
| 302 | args: args{ |
| 303 | statuses: []*common.TSStatus{ |
| 304 | { |
| 305 | Code: SuccessStatus, |
| 306 | Message: &success, |
| 307 | SubStatus: []*common.TSStatus{}, |
| 308 | }, |
| 309 | }, |
| 310 | }, |
| 311 | wantErr: false, |
| 312 | }, |
| 313 | { |
| 314 | name: "RedirectionRecommend", |
| 315 | args: args{ |
| 316 | statuses: []*common.TSStatus{ |
| 317 | { |
| 318 | Code: RedirectionRecommend, |
| 319 | Message: &redirectionRecommend, |
| 320 | SubStatus: []*common.TSStatus{}, |
| 321 | }, |
| 322 | }, |
| 323 | }, |
| 324 | wantErr: false, |
| 325 | }, |
| 326 | } |
| 327 | for _, tt := range tests { |
| 328 | t.Run(tt.name, func(t *testing.T) { |
| 329 | if err := verifySuccesses(tt.args.statuses); (err != nil) != tt.wantErr { |
| 330 | t.Errorf("verifySuccesses() error = %v, wantErr %v", err, tt.wantErr) |
| 331 | } |
| 332 | }) |
| 333 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…