(t *testing.T)
| 532 | } |
| 533 | |
| 534 | func TestAppScriptServiceUsesRuntimeFactory(t *testing.T) { |
| 535 | t.Parallel() |
| 536 | |
| 537 | want := &scriptapi.Service{} |
| 538 | var gotAccount string |
| 539 | runtime := &app.Runtime{Services: app.Services{ |
| 540 | AppScript: func(_ context.Context, account string) (*scriptapi.Service, error) { |
| 541 | gotAccount = account |
| 542 | return want, nil |
| 543 | }, |
| 544 | }} |
| 545 | ctx := app.WithRuntime(context.Background(), runtime) |
| 546 | |
| 547 | got, err := appScriptService(ctx, "test@example.com") |
| 548 | if err != nil { |
| 549 | t.Fatalf("appScriptService() error = %v", err) |
| 550 | } |
| 551 | if got != want { |
| 552 | t.Fatalf("appScriptService() = %p, want %p", got, want) |
| 553 | } |
| 554 | if gotAccount != "test@example.com" { |
| 555 | t.Fatalf("factory account = %q, want test@example.com", gotAccount) |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | func TestCloudIdentityServiceUsesRuntimeFactory(t *testing.T) { |
| 560 | t.Parallel() |
nothing calls this directly
no test coverage detected