public void GetDetectionConfigurationValidatesArguments()
        {
            MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient();

            Assert.That(() => adminClient.GetDetectionConfigurationAsync(null), Throws.InstanceOf <ArgumentNullException>());
            Assert.That(() => adminClient.GetDetectionConfigurationAsync(""), Throws.InstanceOf <ArgumentException>());
            Assert.That(() => adminClient.GetDetectionConfigurationAsync("configId"), Throws.InstanceOf <ArgumentException>().With.InnerException.TypeOf(typeof(FormatException)));

            Assert.That(() => adminClient.GetDetectionConfiguration(null), Throws.InstanceOf <ArgumentNullException>());
            Assert.That(() => adminClient.GetDetectionConfiguration(""), Throws.InstanceOf <ArgumentException>());
            Assert.That(() => adminClient.GetDetectionConfiguration("configId"), Throws.InstanceOf <ArgumentException>().With.InnerException.TypeOf(typeof(FormatException)));
        }
        public void GetDetectionConfigurationRespectsTheCancellationToken()
        {
            MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient();

            using var cancellationSource = new CancellationTokenSource();
            cancellationSource.Cancel();

            Assert.That(() => adminClient.GetDetectionConfigurationAsync(FakeGuid, cancellationSource.Token), Throws.InstanceOf <OperationCanceledException>());
            Assert.That(() => adminClient.GetDetectionConfiguration(FakeGuid, cancellationSource.Token), Throws.InstanceOf <OperationCanceledException>());
        }