(t *testing.T)
| 779 | } |
| 780 | |
| 781 | func TestDriveServiceUsesRuntimeFactory(t *testing.T) { |
| 782 | t.Parallel() |
| 783 | |
| 784 | want := &drive.Service{} |
| 785 | var gotAccount string |
| 786 | runtime := &app.Runtime{Services: app.Services{ |
| 787 | Drive: func(_ context.Context, account string) (*drive.Service, error) { |
| 788 | gotAccount = account |
| 789 | return want, nil |
| 790 | }, |
| 791 | }} |
| 792 | ctx := app.WithRuntime(context.Background(), runtime) |
| 793 | |
| 794 | got, err := driveService(ctx, "test@example.com") |
| 795 | if err != nil { |
| 796 | t.Fatalf("driveService() error = %v", err) |
| 797 | } |
| 798 | if got != want { |
| 799 | t.Fatalf("driveService() = %p, want %p", got, want) |
| 800 | } |
| 801 | if gotAccount != "test@example.com" { |
| 802 | t.Fatalf("factory account = %q, want test@example.com", gotAccount) |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | func TestDriveActivityServiceUsesRuntimeFactory(t *testing.T) { |
| 807 | t.Parallel() |
nothing calls this directly
no test coverage detected