public void AnomalyDetectionConfiguration()
        {
            var id          = "id";
            var name        = "name";
            var description = "description";
            var metricId    = "metricId";
            var wholeSeriesDetectionConditions = new MetricWholeSeriesDetectionCondition();
            var seriesGroupDetectionConditions = new List <MetricSeriesGroupDetectionCondition>()
            {
                new MetricSeriesGroupDetectionCondition(SampleDimensionKey),
                new MetricSeriesGroupDetectionCondition(SampleDimensionKey)
            };
            var seriesDetectionConditions = new List <MetricSingleSeriesDetectionCondition>()
            {
                new MetricSingleSeriesDetectionCondition(SampleDimensionKey),
                new MetricSingleSeriesDetectionCondition(SampleDimensionKey)
            };

            var anomalyDetectionConfiguration = MetricsAdvisorModelFactory.AnomalyDetectionConfiguration(id, name, description, metricId,
                                                                                                         wholeSeriesDetectionConditions, seriesGroupDetectionConditions, seriesDetectionConditions);

            Assert.That(anomalyDetectionConfiguration.Id, Is.EqualTo(id));
            Assert.That(anomalyDetectionConfiguration.Name, Is.EqualTo(name));
            Assert.That(anomalyDetectionConfiguration.Description, Is.EqualTo(description));
            Assert.That(anomalyDetectionConfiguration.MetricId, Is.EqualTo(metricId));
            Assert.That(anomalyDetectionConfiguration.WholeSeriesDetectionConditions, Is.EqualTo(wholeSeriesDetectionConditions));
            Assert.That(anomalyDetectionConfiguration.SeriesGroupDetectionConditions, Is.EqualTo(seriesGroupDetectionConditions));
            Assert.That(anomalyDetectionConfiguration.SeriesDetectionConditions, Is.EqualTo(seriesDetectionConditions));
        }
        public void MetricAnomalyFeedback()
        {
            var id                             = "id";
            var createdOn                      = DateTimeOffset.Parse("2021-01-01T00:00:00Z");
            var userPrincipal                  = "userPrincipal";
            var metricId                       = "metricId";
            var dimensionKey                   = SampleDimensionKey;
            var startsOn                       = DateTimeOffset.Parse("2021-02-02T00:00:00Z");
            var endsOn                         = DateTimeOffset.Parse("2021-03-03T00:00:00Z");
            var anomalyValue                   = AnomalyValue.AutoDetect;
            var detectionConfigurationId       = "id3";
            var detectionConfigurationSnapshot = MetricsAdvisorModelFactory.AnomalyDetectionConfiguration();

            var feedback = MetricsAdvisorModelFactory.MetricAnomalyFeedback(id, createdOn, userPrincipal, metricId, dimensionKey, startsOn,
                                                                            endsOn, anomalyValue, detectionConfigurationId, detectionConfigurationSnapshot);

            Assert.That(feedback.Id, Is.EqualTo(id));
            Assert.That(feedback.CreatedOn, Is.EqualTo(createdOn));
            Assert.That(feedback.UserPrincipal, Is.EqualTo(userPrincipal));
            Assert.That(feedback.MetricId, Is.EqualTo(metricId));
            Assert.That(feedback.DimensionKey, Is.EqualTo(dimensionKey));
            Assert.That(feedback.StartsOn, Is.EqualTo(startsOn));
            Assert.That(feedback.EndsOn, Is.EqualTo(endsOn));
            Assert.That(feedback.AnomalyValue, Is.EqualTo(anomalyValue));
            Assert.That(feedback.DetectionConfigurationId, Is.EqualTo(detectionConfigurationId));
            Assert.That(feedback.DetectionConfigurationSnapshot, Is.EqualTo(detectionConfigurationSnapshot));
        }