(t *testing.T)
| 432 | } |
| 433 | |
| 434 | func Test_WithPrAndIssueQueryParams(t *testing.T) { |
| 435 | type args struct { |
| 436 | baseURL string |
| 437 | state IssueMetadataState |
| 438 | } |
| 439 | tests := []struct { |
| 440 | name string |
| 441 | args args |
| 442 | want string |
| 443 | wantErr bool |
| 444 | }{ |
| 445 | { |
| 446 | name: "blank", |
| 447 | args: args{ |
| 448 | baseURL: "", |
| 449 | state: IssueMetadataState{}, |
| 450 | }, |
| 451 | want: "?body=", |
| 452 | }, |
| 453 | { |
| 454 | name: "no values", |
| 455 | args: args{ |
| 456 | baseURL: "http://example.com/hey", |
| 457 | state: IssueMetadataState{}, |
| 458 | }, |
| 459 | want: "http://example.com/hey?body=", |
| 460 | }, |
| 461 | { |
| 462 | name: "title and body", |
| 463 | args: args{ |
| 464 | baseURL: "http://example.com/hey", |
| 465 | state: IssueMetadataState{ |
| 466 | Title: "my title", |
| 467 | Body: "my bodeh", |
| 468 | }, |
| 469 | }, |
| 470 | want: "http://example.com/hey?body=my+bodeh&title=my+title", |
| 471 | }, |
| 472 | } |
| 473 | for _, tt := range tests { |
| 474 | t.Run(tt.name, func(t *testing.T) { |
| 475 | got, err := WithPrAndIssueQueryParams(nil, nil, tt.args.baseURL, tt.args.state, gh.ProjectsV1Supported) |
| 476 | if (err != nil) != tt.wantErr { |
| 477 | t.Errorf("WithPrAndIssueQueryParams() error = %v, wantErr %v", err, tt.wantErr) |
| 478 | return |
| 479 | } |
| 480 | if got != tt.want { |
| 481 | t.Errorf("WithPrAndIssueQueryParams() = %v, want %v", got, tt.want) |
| 482 | } |
| 483 | }) |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | // TODO projectsV1Deprecation |
| 488 | // Remove this test. |
nothing calls this directly
no test coverage detected