public void AzChangeFailureRateDAIntegrationTest()
        {
            //Arrange
            bool             getSampleData        = true;
            TableStorageAuth tableStorageAuth     = Common.GenerateTableAuthorization(Configuration);
            string           organization         = "samsmithnz";
            string           project              = "SamLearnsAzure";
            string           branch               = "refs/heads/master";
            string           buildName            = "SamLearnsAzure.CI";
            DevOpsPlatform   targetDevOpsPlatform = DevOpsPlatform.AzureDevOps;
            int numberOfDays     = 30;
            int maxNumberOfItems = 20;

            //Act
            ChangeFailureRateDA    da    = new ChangeFailureRateDA();
            ChangeFailureRateModel model = da.GetChangeFailureRate(getSampleData, tableStorageAuth,
                                                                   targetDevOpsPlatform, organization, project, branch, buildName, numberOfDays, maxNumberOfItems);

            //Assert
            Assert.IsTrue(model != null);
            Assert.IsTrue(model.TargetDevOpsPlatform == DevOpsPlatform.AzureDevOps);
            Assert.IsTrue(model.DeploymentName != "");
            Assert.IsTrue(model.ChangeFailureRateMetric > 0f);
            Assert.IsTrue(model.ChangeFailureRateBuildList.Count <= 20f);
            Assert.AreEqual(false, string.IsNullOrEmpty(model.ChangeFailureRateMetricDescription));
            Assert.AreNotEqual("Elite", model.ChangeFailureRateMetricDescription);
            Assert.AreEqual(numberOfDays, model.NumberOfDays);
            Assert.IsTrue(model.MaxNumberOfItems > 0);
            Assert.IsTrue(model.TotalItems > 0);
        }
        public void GHChangeFailureRateDAIntegrationTest()
        {
            //Arrange
            bool             getSampleData        = true;
            TableStorageAuth tableStorageAuth     = Common.GenerateTableAuthorization(Configuration);
            string           owner                = "samsmithnz";
            string           repo                 = "DevOpsMetrics";
            string           branch               = "master";
            string           workflowName         = "DevOpsMetrics CI/CD";
            DevOpsPlatform   targetDevOpsPlatform = DevOpsPlatform.GitHub;
            int numberOfDays     = 30;
            int maxNumberOfItems = 20;

            //Act
            ChangeFailureRateDA    da    = new ChangeFailureRateDA();
            ChangeFailureRateModel model = da.GetChangeFailureRate(getSampleData, tableStorageAuth,
                                                                   targetDevOpsPlatform, owner, repo, branch, workflowName, numberOfDays, maxNumberOfItems);

            //Assert
            Assert.IsTrue(model != null);
            Assert.IsTrue(model.TargetDevOpsPlatform == targetDevOpsPlatform);
            Assert.IsTrue(model.DeploymentName != "");
            Assert.IsTrue(model.ChangeFailureRateMetric > 0f);
            Assert.IsTrue(model.ChangeFailureRateBuildList.Count <= 20f);
            Assert.AreEqual(false, string.IsNullOrEmpty(model.ChangeFailureRateMetricDescription));
            Assert.AreNotEqual("Elite", model.ChangeFailureRateMetricDescription);
            Assert.AreEqual(numberOfDays, model.NumberOfDays);
            Assert.IsTrue(model.MaxNumberOfItems > 0);
            Assert.IsTrue(model.TotalItems > 0);
        }
        public ChangeFailureRateModel GetChangeFailureRate(bool getSampleData,
                                                           DevOpsPlatform targetDevOpsPlatform, string organization_owner, string project_repo, string branch, string buildName_workflowName,
                                                           int numberOfDays, int maxNumberOfItems)
        {
            TableStorageAuth       tableStorageAuth = Common.GenerateTableAuthorization(Configuration);
            ChangeFailureRateDA    da    = new ChangeFailureRateDA();
            ChangeFailureRateModel model = da.GetChangeFailureRate(getSampleData, tableStorageAuth, targetDevOpsPlatform,
                                                                   organization_owner, project_repo, branch, buildName_workflowName,
                                                                   numberOfDays, maxNumberOfItems);

            return(model);
        }