Esempio n. 1
0
        public void Metric_EditMetricByID()
        {
            string METRIC_GUID            = "{45979112-aff6-4bfa-878b-02baa8fd1074}"; // Education : Azure Training
            string METRIC_CATEGORY        = "Updated Metric Category";
            string METRIC_NAME            = "Updated Metric Name";
            string METRIC_DESCRIPTION     = "Updated description blah blah blah...";
            string METRIC_FISCALYEAR_GUID = "c6a45416-81a2-4034-adac-c7eab5225ece"; // 2018
            int    YEAR = 2018;

            ArdaTestMgr.Validate(this, $"Metric.EditMetricByID({METRIC_GUID},{METRIC_CATEGORY},{METRIC_NAME},LongDescription, (Year:{YEAR}) {METRIC_FISCALYEAR_GUID})",
                                 (list, ctx) =>
            {
                MetricRepository metric = new MetricRepository(ctx);

                var row = new MetricViewModel()
                {
                    MetricID       = Guid.Parse(METRIC_GUID),
                    MetricCategory = METRIC_CATEGORY,
                    MetricName     = METRIC_NAME,
                    Description    = METRIC_DESCRIPTION,
                    FiscalYearID   = Guid.Parse(METRIC_FISCALYEAR_GUID),

                    // Ignored data
                    FullNumericFiscalYear = 0,
                    TextualFiscalYear     = "IGNORED"
                };

                metric.EditMetricByID(row);

                return(metric.GetAllMetrics());
            });
        }
Esempio n. 2
0
        public void Metric_AddNewMetric()
        {
            string GUID                   = "{aaaa0011-622a-4656-85df-39edc26be080}";
            string METRIC_CATEGORY        = "My Metric Category";
            string METRIC_NAME            = "My Metric Name";
            string METRIC_DESCRIPTION     = "My very long description of the metric blah blah blah...";
            string METRIC_FISCALYEAR_GUID = "c6a45416-81a2-4034-adac-c7eab5225ece"; // 2018
            int    YEAR                   = 2018;

            ArdaTestMgr.Validate(this, $"Metric.AddNewMetric({GUID},{METRIC_CATEGORY},{METRIC_NAME},LongDescription, (Year:{YEAR}) {METRIC_FISCALYEAR_GUID})",
                                 (list, ctx) =>
            {
                MetricRepository metric = new MetricRepository(ctx);

                var row = new MetricViewModel()
                {
                    MetricID       = Guid.Parse(GUID),
                    MetricCategory = METRIC_CATEGORY,
                    MetricName     = METRIC_NAME,
                    Description    = METRIC_DESCRIPTION,
                    FiscalYearID   = Guid.Parse(METRIC_FISCALYEAR_GUID),

                    // Ignored data
                    FullNumericFiscalYear = 0,
                    TextualFiscalYear     = "IGNORED"
                };

                metric.AddNewMetric(row);

                return(metric.GetAllMetrics());
            });
        }
Esempio n. 3
0
        public void Metric_DeleteMetricByID()
        {
            string METRIC_GUID = "{45979112-aff6-4bfa-878b-02baa8fd1074}"; // Education : Azure Training

            ArdaTestMgr.Validate(this, $"Metric.DeleteMetricByID({METRIC_GUID})",
                                 (list, ctx) =>
            {
                MetricRepository metric = new MetricRepository(ctx);

                metric.DeleteMetricByID(Guid.Parse(METRIC_GUID));

                return(metric.GetAllMetrics());
            });
        }
Esempio n. 4
0
        public void Metric_GetAllMetrics_ByYear()
        {
            int YEAR = 2017;

            ArdaTestMgr.Validate(this, $"Metric.GetAllMetrics({YEAR})",
                                 (list, ctx) =>
            {
                MetricRepository metric = new MetricRepository(ctx);

                var row = metric.GetAllMetrics(YEAR);

                return(row);
            });
        }
Esempio n. 5
0
        public IEnumerable <MetricViewModel> GetSnapshot(TransactionalKanbanContext context)
        {
            MetricRepository metrics = new MetricRepository(context);

            return(metrics.GetAllMetrics());
        }