(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestSelectCollectionObjects(t *testing.T) { |
| 74 | ctx := context.Background() |
| 75 | client, requester := newClient(t) |
| 76 | testCases := []struct { |
| 77 | ids []string |
| 78 | collection string |
| 79 | expectedURL string |
| 80 | expectedBody string |
| 81 | }{ |
| 82 | { |
| 83 | collection: "test-single", |
| 84 | ids: []string{"one"}, |
| 85 | expectedURL: "https://api.stream-io-api.com/api/v1.0/collections/?api_key=key&foreign_ids=" + url.QueryEscape("test-single:one"), |
| 86 | }, |
| 87 | { |
| 88 | collection: "test-multiple", |
| 89 | ids: []string{"one", "two", "three"}, |
| 90 | expectedURL: "https://api.stream-io-api.com/api/v1.0/collections/?api_key=key&foreign_ids=" + url.QueryEscape("test-multiple:one,test-multiple:two,test-multiple:three"), |
| 91 | }, |
| 92 | } |
| 93 | for _, tc := range testCases { |
| 94 | _, err := client.Collections().Select(ctx, tc.collection, tc.ids...) |
| 95 | require.NoError(t, err) |
| 96 | testRequest(t, requester.req, http.MethodGet, tc.expectedURL, tc.expectedBody) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestDeleteManyCollectionObjects(t *testing.T) { |
| 101 | ctx := context.Background() |
nothing calls this directly
no test coverage detected