Exemplo n.º 1
0
        public void ImportOptionalFromExcelRegressionTest()
        {
            createPaymentProfileFileName = TestResources.GetTestResourcesFile(@"AutoPilot\ImportOptionalValue\createPayment.xml");
            ImportOptionalValues.CreateParser(createPaymentProfileFileName);
            APIConfigurationsDocumentParserBase parser = ImportOptionalValues.CurrentParser;

            createPaymentProfileModels          = parser.ParseDocument(createPaymentProfileFileName);
            ImportOptionalValues.ExcelFileName  = TestResources.GetTestResourcesFile(@"AutoPilot\ImportOptionalValue\CretaePaymentOptinalValues.xlsx");
            ImportOptionalValues.ExcelSheetName = "wsdl_createPayment";
            DataTable dt = ImportOptionalValues.GetExceSheetlData();
            Dictionary <string, List <string> > dic = ImportOptionalValues.UpdateParametersOptionalValuesFromCurrentExcelTable();

            ImportOptionalValues.PopulateExcelDBOptionalValuesForAPIParametersExcelDB(createPaymentProfileModels[0], createPaymentProfileModels[0].AppModelParameters.ToList(), dic);

            Assert.AreEqual(createPaymentProfileModels.Count, 1, "APIModels count");
            Assert.AreEqual(createPaymentProfileModels[0].AppModelParameters.Count, 26, "AppModelParameters count");
            Assert.AreEqual(createPaymentProfileModels[0].AppModelParameters[0].OptionalValuesList.Count, 7, "Optional Values Count After Import From Excel");
            Assert.AreEqual(dic.Count, 9, "Count of Parameters With New Optional Values");
        }
Exemplo n.º 2
0
        public void ImportOptionalFromDBRegressionTest()
        {
            createPaymentProfileFileName = TestResources.GetTestResourcesFile(@"AutoPilot\ImportOptionalValue\createPayment.xml");
            ImportOptionalValues.CreateParser(createPaymentProfileFileName);
            APIConfigurationsDocumentParserBase parser = ImportOptionalValues.CurrentParser;

            ObservableList <ApplicationAPIModel> createPaymentProfileModels = parser.ParseDocument(createPaymentProfileFileName);

            ImportOptionalValues.SetDBDetails("Oracle", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = illin056)(PORT = 1521))(CONNECT_DATA = (sid = ATSTSTDB)))", "GingerTST", "GingerTST");
            if (ImportOptionalValues.Connect())
            {
                string query = @"SELECT PARAM_1 AS ""{MESSAGETAG}"", PARAM_2 AS ""{APPLICATIONID}"" FROM ginger_importoptionalvalue";
                ImportOptionalValues.ExecuteFreeSQL(query);
                Dictionary <string, List <string> > dic = ImportOptionalValues.UpdateParametersOptionalValuesFromDB();
                ImportOptionalValues.PopulateExcelDBOptionalValuesForAPIParametersExcelDB(createPaymentProfileModels[0], createPaymentProfileModels[0].AppModelParameters.ToList(), dic);
            }
            Assert.AreEqual(createPaymentProfileModels.Count, 1, "APIModels count");
            Assert.AreEqual(createPaymentProfileModels[0].AppModelParameters.Count, 26, "AppModelParameters count");
            Assert.AreEqual(createPaymentProfileModels[0].AppModelParameters[0].OptionalValuesList.Count, 3, "First Optional Values Count After Import From DB");
            Assert.AreEqual(createPaymentProfileModels[0].AppModelParameters[1].OptionalValuesList.Count, 2, "Second Optional Values Count After Import From DB");
        }