(t *testing.T)
| 904 | } |
| 905 | |
| 906 | func TestSlidesServiceUsesRuntimeFactory(t *testing.T) { |
| 907 | t.Parallel() |
| 908 | |
| 909 | want := &slides.Service{} |
| 910 | var gotAccount string |
| 911 | runtime := &app.Runtime{Services: app.Services{ |
| 912 | Slides: func(_ context.Context, account string) (*slides.Service, error) { |
| 913 | gotAccount = account |
| 914 | return want, nil |
| 915 | }, |
| 916 | }} |
| 917 | ctx := app.WithRuntime(context.Background(), runtime) |
| 918 | |
| 919 | got, err := slidesService(ctx, "test@example.com") |
| 920 | if err != nil { |
| 921 | t.Fatalf("slidesService() error = %v", err) |
| 922 | } |
| 923 | if got != want { |
| 924 | t.Fatalf("slidesService() = %p, want %p", got, want) |
| 925 | } |
| 926 | if gotAccount != "test@example.com" { |
| 927 | t.Fatalf("factory account = %q, want test@example.com", gotAccount) |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | func TestRequireGmailServiceUsesRuntimeFactory(t *testing.T) { |
| 932 | t.Parallel() |
nothing calls this directly
no test coverage detected