private void ValidateResourceHealth(ResourceHealth resource)
        {
            Assert.NotNull(resource);
            Assert.True(InfrastructureInsightsCommon.ValidateResource(resource));

            Assert.NotNull(resource.AlertSummary);
            Assert.NotNull(resource.HealthState);
            Assert.NotNull(resource.NamespaceProperty);
            Assert.NotNull(resource.RegistrationId);
            Assert.NotNull(resource.RoutePrefix);
            Assert.NotNull(resource.ResourceDisplayName);
            Assert.NotNull(resource.ResourceLocation);
            Assert.NotNull(resource.ResourceName);
            Assert.NotNull(resource.ResourceType);
            Assert.NotNull(resource.ResourceURI);
            Assert.NotNull(resource.RpRegistrationId);
            Assert.NotNull(resource.ResourceName);
            Assert.NotNull(resource.UsageMetrics);
        }
Ejemplo n.º 2
0
        private void ValidateRegionHealth(RegionHealth regionHealth)
        {
            InfrastructureInsightsCommon.ValidateResource(regionHealth);

            // Alert summary
            Assert.NotNull(regionHealth.AlertSummary);
            Assert.NotNull(regionHealth.AlertSummary.CriticalAlertCount);
            Assert.NotNull(regionHealth.AlertSummary.WarningAlertCount);

            // Not null and have values
            Assert.True(regionHealth.AlertSummary.CriticalAlertCount >= 0);
            Assert.True(regionHealth.AlertSummary.WarningAlertCount >= 0);

            // Usage metrics
            Assert.NotNull(regionHealth.UsageMetrics);
            foreach (var usageMetrics in regionHealth.UsageMetrics)
            {
                ValidateUsageMetrics(usageMetrics);
            }
        }