(t *testing.T)
| 729 | } |
| 730 | |
| 731 | func TestAnalyticsDataServiceUsesRuntimeFactory(t *testing.T) { |
| 732 | t.Parallel() |
| 733 | |
| 734 | want := &analyticsdata.Service{} |
| 735 | var gotAccount string |
| 736 | runtime := &app.Runtime{Services: app.Services{ |
| 737 | AnalyticsData: func(_ context.Context, account string) (*analyticsdata.Service, error) { |
| 738 | gotAccount = account |
| 739 | return want, nil |
| 740 | }, |
| 741 | }} |
| 742 | ctx := app.WithRuntime(context.Background(), runtime) |
| 743 | |
| 744 | got, err := analyticsDataService(ctx, "test@example.com") |
| 745 | if err != nil { |
| 746 | t.Fatalf("analyticsDataService() error = %v", err) |
| 747 | } |
| 748 | if got != want { |
| 749 | t.Fatalf("analyticsDataService() = %p, want %p", got, want) |
| 750 | } |
| 751 | if gotAccount != "test@example.com" { |
| 752 | t.Fatalf("factory account = %q, want test@example.com", gotAccount) |
| 753 | } |
| 754 | } |
| 755 | |
| 756 | func TestSearchConsoleServiceUsesRuntimeFactory(t *testing.T) { |
| 757 | t.Parallel() |
nothing calls this directly
no test coverage detected