コード例 #1
0
        public void Validate_ResourceDiscoveryIsFullyConfigured_Success()
        {
            // Arrange
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.True(validationResult.IsSuccessful);
        }
コード例 #2
0
        public void Validate_ResourceDiscoveryIsFullyConfigured_Success()
        {
            // Arrange
            var metricsDeclarationProvider     = GetMetricDeclarationProvider();
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.True(validationResult.IsSuccessful);
        }
コード例 #3
0
        public void Validate_ResourceDiscoveryIsNotConfigured_Success()
        {
            // Arrange
            ResourceDiscoveryConfiguration resourceDiscoveryConfiguration = null;

            // Act
            // ReSharper disable once ExpressionIsAlwaysNull
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.True(validationResult.IsSuccessful);
        }
コード例 #4
0
        public void Validate_ResourceDiscoveryIsNotConfiguredButMetricWithDiscoveryIsDefined_Fails()
        {
            // Arrange
            var metricsDeclarationProvider = GetMetricDeclarationProvider(useDiscoveryGroup: true);
            IOptions <ResourceDiscoveryConfiguration> resourceDiscoveryConfiguration = null;

            // Act
            // ReSharper disable once ExpressionIsAlwaysNull
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.False(validationResult.IsSuccessful);
        }
コード例 #5
0
        public void Validate_NoHostIsConfigured_Fails(string host)
        {
            // Arrange
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Host = host;

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.False(validationResult.IsSuccessful);
        }
コード例 #6
0
        public void Validate_StatsDWithPortZero_Fails()
        {
            // Arrange
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Port = 0;

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.False(validationResult.IsSuccessful);
        }
コード例 #7
0
        public void Validate_ResourceDiscoveryConfigurationIsNotConfigured_Success()
        {
            // Arrange
            var metricsDeclarationProvider = GetMetricDeclarationProvider();
            IOptions <ResourceDiscoveryConfiguration> resourceDiscoveryConfiguration = null;

            // Act
            // ReSharper disable once ExpressionIsAlwaysNull
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            PromitorAssert.ValidationIsSuccessful(validationResult);
        }
コード例 #8
0
        public void Validate_StatsDWithPortZero_Fails()
        {
            // Arrange
            var metricsDeclarationProvider     = GetMetricDeclarationProvider();
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Value.Port = 0;

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.False(validationResult.IsSuccessful);
        }
コード例 #9
0
        public void Validate_NoHostIsConfigured_Succeeds(string host)
        {
            // Arrange
            var metricsDeclarationProvider     = GetMetricDeclarationProvider();
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Value.Host = host;

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            PromitorAssert.ValidationIsSuccessful(validationResult);
        }
コード例 #10
0
        public void Validate_PortIsZero_Fails()
        {
            // Arrange
            var metricsDeclarationProvider     = GetMetricDeclarationProvider();
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Value.Port = 0;

            // Act
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            PromitorAssert.ValidationFailed(validationResult);
        }
コード例 #11
0
        public void Validate_ResourceDiscoveryHostIsNotConfigured_Success()
        {
            // Arrange
            var metricsDeclarationProvider     = GetMetricDeclarationProvider();
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Value.Host = string.Empty;

            // Act
            // ReSharper disable once ExpressionIsAlwaysNull
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            Assert.True(validationResult.IsSuccessful);
        }
コード例 #12
0
        public void Validate_NoResourceDiscoveryHostIsNotConfiguredButMetricWithDiscoveryIsDefined_Fails()
        {
            // Arrange
            var metricsDeclarationProvider     = GetMetricDeclarationProvider(useDiscoveryGroup: true);
            var resourceDiscoveryConfiguration = CreateRuntimeConfiguration();

            resourceDiscoveryConfiguration.Value.Host = string.Empty;

            // Act
            // ReSharper disable once ExpressionIsAlwaysNull
            var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration, metricsDeclarationProvider, NullLogger <ResourceDiscoveryValidationStep> .Instance);
            var validationResult = azureAuthenticationValidationStep.Run();

            // Assert
            PromitorAssert.ValidationFailed(validationResult);
        }