public void GetDataFeedIngestionProgressValidatesArguments() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); Assert.That(() => adminClient.GetDataFeedIngestionProgressAsync(null), Throws.InstanceOf <ArgumentNullException>()); Assert.That(() => adminClient.GetDataFeedIngestionProgressAsync(""), Throws.InstanceOf <ArgumentException>()); Assert.That(() => adminClient.GetDataFeedIngestionProgressAsync("dataFeedId"), Throws.InstanceOf <ArgumentException>().With.InnerException.TypeOf(typeof(FormatException))); Assert.That(() => adminClient.GetDataFeedIngestionProgress(null), Throws.InstanceOf <ArgumentNullException>()); Assert.That(() => adminClient.GetDataFeedIngestionProgress(""), Throws.InstanceOf <ArgumentException>()); Assert.That(() => adminClient.GetDataFeedIngestionProgress("dataFeedId"), Throws.InstanceOf <ArgumentException>().With.InnerException.TypeOf(typeof(FormatException))); }
public void GetDataFeedIngestionProgressRespectsTheCancellationToken() { MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(); using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); Assert.That(() => adminClient.GetDataFeedIngestionProgressAsync(FakeGuid, cancellationSource.Token), Throws.InstanceOf <OperationCanceledException>()); Assert.That(() => adminClient.GetDataFeedIngestionProgress(FakeGuid, cancellationSource.Token), Throws.InstanceOf <OperationCanceledException>()); }