public void PropertiesReflectClientIdFactory() { var o = ListSubscriptionsRequest.WithClientId(Channel, ClientId, Limit); o.Channel.Should().Be(Channel); o.ClientId.Should().Be(ClientId); o.DeviceId.Should().BeNull(); o.Limit.Should().Be(Limit); }
public async Task List_ShouldPassTheCorrectFilters() { async Task <AblyRequest> CallList(ListSubscriptionsRequest filter) { AblyRequest request = null; var rest = GetRestClient(r => { request = r; return(Task.FromResult(new AblyResponse() { TextResponse = "[]" })); }); await rest.Push.Admin.ChannelSubscriptions.ListAsync(filter); return(request); } var emptyFilterRequest = await CallList(ListSubscriptionsRequest.Empty(100)); emptyFilterRequest.QueryParameters.Should().ContainKey("limit").WhoseValue.Should().Be("100"); var channelDeviceIdRequest = await CallList(ListSubscriptionsRequest.WithDeviceId("test-channel", "device123")); channelDeviceIdRequest.QueryParameters.Should().ContainKey("channel") .WhoseValue.Should().Be("test-channel"); channelDeviceIdRequest.QueryParameters.Should().ContainKey("deviceId") .WhoseValue.Should().Be("device123"); var channelClientIdRequest = await CallList(ListSubscriptionsRequest.WithClientId("test-channel", "clientId123")); channelClientIdRequest.QueryParameters.Should().ContainKey("channel") .WhoseValue.Should().Be("test-channel"); channelClientIdRequest.QueryParameters.Should().ContainKey("clientId") .WhoseValue.Should().Be("clientId123"); }