public void Validate_ResourceDiscoveryIsFullyConfigured_Success() { // Arrange var resourceDiscoveryConfiguration = CreateRuntimeConfiguration(); // Act var azureAuthenticationValidationStep = new ResourceDiscoveryValidationStep(resourceDiscoveryConfiguration); var validationResult = azureAuthenticationValidationStep.Run(); // Assert Assert.True(validationResult.IsSuccessful); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }