Ejemplo n.º 1
0
        public void CustomerWin_UserInterface()
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Cust.OpenCustomerWindow();
            string sValue = GetLabel(Cust.wCustomerWin, AppConstants.LBL_RESULTSCOUNT).Name;

            LoggerUtility.WriteLog("<Info: The Number Of Customers Are [" + sValue + "]>");

            Assert.True(Cust.IsTableHeaderContains(AppConstants.TBL_CUST_DETAILS, AppConstants.LBL_TITLE_FNAME));
            LoggerUtility.StatusPass("Verified The TableHeader For The Title - " + AppConstants.LBL_TITLE_FNAME);

            Assert.True(Cust.IsTableHeaderContains(AppConstants.TBL_CUST_DETAILS, AppConstants.LBL_TITLE_LNAME));
            LoggerUtility.StatusPass("Verified The TableHeader For The Title - " + AppConstants.LBL_TITLE_LNAME);

            Assert.True(Cust.IsTableHeaderContains(AppConstants.TBL_CUST_DETAILS, AppConstants.LBL_TITLE_PHONE));
            LoggerUtility.StatusPass("Verified The TableHeader For The Title - " + AppConstants.LBL_TITLE_PHONE);

            Assert.True(Cust.IsTableHeaderContains(AppConstants.TBL_CUST_DETAILS, AppConstants.LBL_TITLE_EMAIL));
            LoggerUtility.StatusPass("Verified The TableHeader For The Title - " + AppConstants.LBL_TITLE_EMAIL);

            Assert.True(Cust.btnAddCustomer.Enabled);
            LoggerUtility.StatusPass("Verified The Button [" + Cust.btnAddCustomer.Name + "] Is Enabled");

            Assert.True(Cust.btnSearchCustomer.Enabled);
            LoggerUtility.StatusPass("Verified The Button [" + Cust.btnSearchCustomer.Name + "] Is Enabled");

            Cust.CloseCustomerWindow();
        }
Ejemplo n.º 2
0
        private static DataRow crawlRow(DataRow row, out bool isCompanyCrawled)
        {
            DataRow dr = row;

            isCompanyCrawled = false;
            try

            {
                //string t = "Grubstake, Llc";
                //string searchQuery = "http://api.opencorporates.com/v0.4/companies/search?q=" + t.ToString().Replace(' ', '+');
                string searchQuery       = "http://api.opencorporates.com/v0.4/companies/search?q=" + dr[CompanyEnum.COMPANY_NAME].ToString().Replace(' ', '+');
                string companyListString = HTTPUtility.getStringFromUrl(searchQuery);

                var jsonResponse = JsonConvert.DeserializeObject <JsonResponse>(companyListString);
                if (jsonResponse != null && jsonResponse.results.companies.Count > 0)
                {
                    var selectedCompany = jsonResponse.results.companies.FirstOrDefault(c => c.company.inactive == false).company;
                    if (selectedCompany != null)
                    {
                        int _delay = 2;
                        int.TryParse(Delay, out _delay);
                        _delay = _delay == 0 ? 2 * 1000 : _delay * 1000;

                        Thread.Sleep(_delay);
                        string coQuery = "http://api.opencorporates.com/v0.4/companies/" + selectedCompany.jurisdiction_code + "/" + selectedCompany.company_number;

                        string companyResultString = HTTPUtility.getStringFromUrl(coQuery);
                        Thread.Sleep(_delay);
                        var companyResultResponse = JsonConvert.DeserializeObject <JsonResponseCompanyResult>(companyResultString);
                        if (companyResultResponse != null)
                        {
                            var companyData = companyResultResponse.results.company;

                            dr[CompanyEnum.OWNER_F_NAME] = getName(companyData.agent_name, true);
                            dr[CompanyEnum.OWNER_l_NAME] = getName(companyData.agent_name, false);
                            dr[CompanyEnum.OWNER_ADDR]   = companyData.registered_address != null ? companyData.registered_address.street_address : companyData.registered_address_in_full;
                            dr[CompanyEnum.OWNER_CITY]   = companyData.registered_address?.locality ?? "";
                            int z = 0000;
                            int.TryParse(companyData.registered_address?.postal_code, out z);
                            dr[CompanyEnum.OWNER_STATE] = companyData.registered_address?.region ?? "";
                            dr[CompanyEnum.OWNER_ZIP]   = z;
                            string mailDescription = string.IsNullOrEmpty(getMailAddr(companyData)) ? companyData.registered_address_in_full ?? "" : "";
                            dr[CompanyEnum.MAIL_ADDR]  = mailDescription;
                            dr[CompanyEnum.MAIL_UNIT]  = getMailUnits(mailDescription, 1);
                            dr[CompanyEnum.MAIL_CITY]  = getMailUnits(mailDescription, 2);
                            dr[CompanyEnum.MAIL_STATE] = getMailUnits(mailDescription, 3);
                            dr[CompanyEnum.MAIL_ZIP]   = getMailUnits(mailDescription, 4);

                            isCompanyCrawled = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LoggerUtility.Write("Failed to crawl " + row["company name"].ToString(), ex.Message);
                isCompanyCrawled = false;
            }
            return(dr);
        }
Ejemplo n.º 3
0
        public void EnterSalesAdvisor(string sSalesAdvisorID)
        {
            // Checks the AppState[1415]
            wVStoreMainWindow.WaitWhileBusy();
            Label majorPromptLabel = GetLabel(AppConstants.MAJOR_PROMPT);

            wVStoreMainWindow.WaitWhileBusy();
            Label appState_1415 = GetAppState(StateConstants.STATE_1415);

            if (appState_1415.NameMatches(StateConstants.STATE_1415) && majorPromptLabel.NameMatches(AppConstants.SALES_ADVISOR_LABEL))
            {
                try
                {
                    //Verify the State Transition to [1000]
                    this.EnterCredential(sSalesAdvisorID);
                    Label appState_1000 = GetAppState(StateConstants.STATE_1000);
                    LoggerUtility.StatusInfo("Entered The Sales Advisor Details With ID " + sSalesAdvisorID);
                    Assert.True(appState_1000.Enabled);
                }
                catch (AssertionException ex)
                {
                    Console.WriteLine("Failure Message: " + ex.StackTrace);
                    throw;
                }
            }
        }
Ejemplo n.º 4
0
        public static DataTable ParseCompaniesData(DataTable filteredTable)
        {
            DataTable updatedTable = new DataTable();

            try
            {
                updatedTable = filteredTable.Clone();
                int i = 0;
                foreach (DataRow row in filteredTable.Rows)
                {
                    bool    isCompanyCrawled = false;
                    DataRow dr  = crawlRow(row, out isCompanyCrawled);
                    DataRow _dr = updatedTable.NewRow();
                    updatedTable.ImportRow(dr);
                    i++;
                    if (isCompanyCrawled)
                    {
                        Console.WriteLine("Company Data Found :" + row[CompanyEnum.COMPANY_NAME]);

                        ExcelUtilities.ExportToExcelOleDb(updatedTable, companiesRecordSheet, OutputFilePath, "updatedCompanies.xlsx", true);
                    }
                }
            }
            catch (Exception ex)
            {
                LoggerUtility.Write("Data Parsing Failed ", ex.Message);
                ExcelUtilities.ExportToExcelOleDb(updatedTable, companiesRecordSheet, OutputFilePath, "updatedCompanies.xlsx", true);
            }
            return(updatedTable);
        }
Ejemplo n.º 5
0
 //[Test]
 public void InvalidSearchTest()
 {
     testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
     LoggerUtility.StartTest(testName);
     LoggerUtility.WriteLog("GETHU MAMAEE");
     //Need to Add Tests For Invalid Searches
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Print, Email, Print Email the receipt based on the Print Option and Email (Optional)
        /// </summary>
        /// <param name="sPrintOption"></param>
        /// <param name="sEmail"></param>
        /// <returns></returns>
        public bool PrintReceipt(string sPrintOption, string sEmail = null)
        {
            Boolean bResults = false;

            try
            {
                VerifyAppStateAndLabel(StateConstants.STATE_9905, AppConstants.PRINT_RECEIPT_PROMPT);

                switch (sPrintOption)
                {
                case "Print":
                    PressSpecialKey(KeyboardInput.SpecialKeys.F1);
                    break;

                case "Email":
                    PressSpecialKey(KeyboardInput.SpecialKeys.F2);
                    //To Be Implemented
                    break;

                case "PrintAndEmail":
                    PressSpecialKey(KeyboardInput.SpecialKeys.F3);
                    //To Be Implemented
                    break;
                }
                LoggerUtility.StatusInfo("Printing the Receipt & The Option is " + sPrintOption);
                return(!bResults);
            }
            catch (Exception ex)
            {
                return(bResults);

                throw new AutomationException("Error: The App Failed to Print the Receipt", ex.StackTrace);
            }
        }
Ejemplo n.º 7
0
        public void WorldInitSuccessTest()
        {
            List <EntityData> entities = new List <EntityData>();

            entities.Add(new EntityData("TestEntityType", "GameUtilities.Entities.BaseEntity,GameUtilities"));
            WorldData data = new WorldData("TEST", "TEST", entities);

            target = new BaseWorld(data);
            obj    = new PrivateObject(target);
            logger = new LoggerUtility("logger");
            obj.SetFieldOrProperty("mLogger", logger);
            Mock <IExecutableContext> contextMock = new Mock <IExecutableContext>();
            Mock <IMessageRouter>     routerMock  = new Mock <IMessageRouter>();
            ConfigManager             config      = new ConfigManager();

            config.Init(".\\TestConfig\\");
            contextMock.Setup(f => f.MessageRouter).Returns(routerMock.Object);
            contextMock.Setup(f => f.ConfigManager).Returns(config);

            target.Init(contextMock.Object);

            Assert.IsTrue(logger.ErrorMessages.Count == 0);
            List <IEntity> entList = (List <IEntity>)obj.GetFieldOrProperty("EntityList");
            Dictionary <string, IEntity> EntityIdDictionary = (Dictionary <string, IEntity>)obj.GetFieldOrProperty("EntityIdDictionary");

            Assert.AreEqual(1, entList.Count);
            Assert.AreEqual(1, EntityIdDictionary.Keys.Count);
        }
Ejemplo n.º 8
0
        public static List <Result> GetNewsList(string company, string fromDate, string toDate)
        {
            List <Result> newsResult = new List <Result>();

            try
            {
                int    retry  = _retry;
                string _fDate = ConverterUtility.ParseDate(fromDate);
                string _tDate = ConverterUtility.ParseDate(toDate);
                string facet  = getCompanyFacet(company);
                while (retry > 0)
                {
                    LoggerUtility.WriteLog("Searching Data: ", "Params : \n Company :" + company + "\n Facet : " + facet + "\n From Date : " + _fDate + "\n To Date : " + _tDate + "\n Retry : " + retry);
                    var _result = getNewsList(company, facet, _fDate, _tDate);
                    Thread.Sleep(_delay);
                    if (_result != null && _result.Count > 0)
                    {
                        newsResult = _result;
                        retry      = 0;
                    }
                    else
                    {
                        retry--;
                        _fDate = ConverterUtility.AddDays(_fDate, -2);
                        _tDate = ConverterUtility.AddDays(_tDate, 2);
                    }
                }
            }
            catch (Exception ex)
            {
                LoggerUtility.WriteLog("Error in Getting News List", ex.Message);
            }
            return(newsResult);
        }
Ejemplo n.º 9
0
        public void Transaction_Hold_WithCustomer()
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Trans.StartTransaction();
            Emp.AuthenticateUser(CommonData.EMP_ID, CommonData.EMP_PWD);

            Cust.SetCustomer(CommonData.sCutomerName);
            Assert.True(Cust.VerifyCustomerIsSet(CommonData.sCutomerName), "Loading the Customer");

            Emp.EnterSalesAdvisor(CommonData.SALES_ADVISOR_ID);
            Trans.ScanBarCode(CommonData.ZERIA_BLACK_9);
            string sTransactionNumber = Trans.GetCurrentTransactionNmbr();

            Assert.True(Trans.HoldTransaction(), "Hold The Transaction");
            LoggerUtility.StatusPass("Placing The " + sTransactionNumber + " On HOLD");

            //Verfiy OnHold Transactions from  Cust
            Cust.OpenCustomerWindow();
            Cust.SearchCustomers("Paul Summer");
            Assert.True(Trans.IsTransactionOnHoldAtCustForm(sTransactionNumber), "Verifying The Transaction On HOLD");
            LoggerUtility.StatusPass("The " + sTransactionNumber + " Is Put On HOLD");
            Cust.CloseCustomerWindow();

            //Verify OnHold Transactions from ResumeTransactions
            Trans.ResumeTransaction();
            Trans.SelectResumeTransactionTab(AppConstants.TAB_HOLD);
            Assert.True(Trans.IsTransactionOnHold(sTransactionNumber));
            LoggerUtility.StatusPass("Verified The Transaction With # " + sTransactionNumber + "Is On HOLD");

            //Void Transaction
            Assert.True(Trans.VoidSuspendedTransaction(sTransactionNumber), "Step: Void The Suspended Transaction");
        }
Ejemplo n.º 10
0
        public bool SearchCustomers(string sCustomer)
        {
            Boolean bResults = false;

            Thread.Sleep(1000);

            try
            {
                wCustomerWin.WaitWhileBusy();
                SetTextByID(wCustomerWin, AppConstants.TXT_SEARCH_ID, sCustomer);
                ClickOnButton(GetButton(wCustomerWin, ButtonConstants.BTN_SEARCH_CUST));
                wCustomerWin.WaitWhileBusy();
                Thread.Sleep(1000);

                Label SearchResults = GetLabel(wCustomerWin, AppConstants.LBL_SEARCH_RESULTS);
                if (SearchResults.Text != "Displaying 1 of 1 Customer")
                {
                    GetListView(wCustomerWin, "dataGrid1").Row("First Name", "Paul").Select();
                    wCustomerWin.WaitWhileBusy();
                }
                LoggerUtility.StatusInfo("Searching The Customer With Name : " + sCustomer);

                return(this.IsCustomerSelected(sCustomer));
            }
            catch (Exception Ex)
            {
                if (wCustomerWin.Enabled)
                {
                    CloseCustomerWindow();
                }
                return(bResults);

                throw new AutomationException("Failed to Search the Customer", Ex.StackTrace);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Method to Fetch the Value Of a Field From the DataBase
        /// </summary>
        /// <param name="sQuery">DB Query String</param>
        /// <param name="sFieldName">Name Of the Field in String </param>
        /// <returns></returns>
        public string RetrieveFieldValueFromDB(string sQuery, string sFieldName)
        {
            OracleConn = new OracleConnection();
            OracleConn.ConnectionString = GetConnectionString();
            string sFieldValue = null;

            try
            {
                OracleConn.Open();

                Console.WriteLine("State: {0}", OracleConn.State);
                Console.WriteLine("ConnectionString: {0}",
                                  OracleConn.ConnectionString);

                OracleCommand Cmd = OracleConn.CreateCommand();
                Cmd.CommandText = sQuery;
                OracleDataReader Reader = Cmd.ExecuteReader();

                while (Reader.Read())
                {
                    var myFieldValue = Reader[sFieldName];
                    LoggerUtility.WriteLog("<Info: The Value Of The Count - [" + myFieldValue.ToString() + "]>");
                    OracleConn.Close();
                    OracleConn.Dispose();
                    return(sFieldValue = myFieldValue.ToString());
                }
            }
            catch (Exception ex)
            {
                //If there is an error Print it to the Page.
                return(ex.Message);
            }
            return(sFieldValue);
        }
Ejemplo n.º 12
0
        public void Transaction_Suspend_WithCustomer()
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Trans.StartTransaction();
            Emp.AuthenticateUser(CommonData.EMP_ID, CommonData.EMP_PWD);

            Cust.SetCustomer(CommonData.sCutomerName);
            Assert.True(Cust.VerifyCustomerIsSet(CommonData.sCutomerName));

            Emp.EnterSalesAdvisor(CommonData.SALES_ADVISOR_ID);
            Trans.ScanBarCode(CommonData.ZERIA_BLACK_9);

            string sTransactionNumber = Trans.GetCurrentTransactionNmbr();

            Assert.True(Trans.SuspendTransaction(), "Step: Suspend Transaction");
            Assert.True(Trans.ResumeTransaction(), "Step: Resume Transaction");

            Trans.SelectResumeTransactionTab(AppConstants.TAB_SUSPEND);
            Assert.True(Trans.IsTransactionSuspended(sTransactionNumber), "Verify Transaction Suspended");
            LoggerUtility.StatusPass("Verified The Transaction Is Suspended");

            //VoidSuspendedTransaction
            Assert.True(Trans.VoidSuspendedTransaction(sTransactionNumber), "Void The Suspended Transaction");
        }
Ejemplo n.º 13
0
        public void ConnectToVStoreDB()
        {
            string sQuery = "select count(*) from customer";

            OracleConn = new OracleConnection();
            OracleConn.ConnectionString = GetConnectionString();
            OracleConn.Open();

            Console.WriteLine("State: {0}", OracleConn.State);
            Console.WriteLine("ConnectionString: {0}",
                              OracleConn.ConnectionString);

            OracleCommand Cmd = OracleConn.CreateCommand();

            Cmd.CommandText = sQuery;

            OracleDataReader Reader = Cmd.ExecuteReader();

            while (Reader.Read())
            {
                var myField = Reader["COUNT(*)"];
                LoggerUtility.WriteLog("<Info: The Value Of The Count - " + myField.ToString() + ">");
            }

            OracleConn.Close();
            OracleConn.Dispose();
        }
Ejemplo n.º 14
0
        public bool AddNewCustomer()
        {
            Boolean bResults = false;

            try
            {
                this.OpenCustomerWindow();

                ClickOnButton(wCustomerWin, ButtonConstants.BTN_ADD_CUST);
                LoggerUtility.WriteLog("Clicked the Add");

                Window wCustomerAddWin = GetChildWindowByID(wCustomerWin, AppConstants.WIN_CUSTOMER_ADD);
                wCustomerAddWin.WaitWhileBusy();

                PropertyGrid FirstNamePlaceHolder = wCustomerAddWin.Get <PropertyGrid>(SearchCriteria.ByAutomationId("C_CUSTOMERFIELD_1"));
                LoggerUtility.WriteLog("Got the wCustomerAddWin Control, going to Perform Entry");
                TextBox txtAddCust = FirstNamePlaceHolder.Get <TextBox>(SearchCriteria.ByClassName("WindowsForms10.RichEdit20W.app.0.1a8c1fa_r14_ad1"));
                txtAddCust.Focus();
                txtAddCust.Text = "Sahaya";

                LoggerUtility.WriteLog("Jerish Name Entered");
                Thread.Sleep(10000);
                return(true);
            }
            catch
            {
                LoggerUtility.WriteLog("Failure Message: Failed to Select the Customer");
                return(bResults);

                throw;
            }
        }
Ejemplo n.º 15
0
        public void Transaction_Suspend_NoCustomer()
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Trans.StartTransaction();
            Emp.AuthenticateUser(CommonData.EMP_ID, CommonData.EMP_PWD);

            WaitForWinToLoad(Cust.wCustomerWin);
            Cust.CloseCustomerWindow();
            //Assert.True(Cust.VerifyNoCustomerIsSelected());
            LoggerUtility.StatusPass("Verification Of NoCustomer is Selected");

            Emp.EnterSalesAdvisor(CommonData.SALES_ADVISOR_ID);
            Trans.ScanBarCode(CommonData.ZERIA_BLACK_9);
            LoggerUtility.StatusInfo("Scanned and Tendered The Transaction");

            string sTransactionNumber = Trans.GetCurrentTransactionNmbr();

            //Suspend Transactions
            Assert.True(Trans.SuspendTransaction(), "Suspending the Transaction");
            LoggerUtility.StatusPass("Suspending The Transaction");

            //ResumeTransactions
            Assert.True(Trans.ResumeTransaction(), "Resume The Transaction");
            LoggerUtility.StatusPass("Resuming The Transaction");

            //Select SuspendTab & Suspend the Transaction
            Trans.SelectResumeTransactionTab(AppConstants.TAB_SUSPEND);
            Assert.True(Trans.IsTransactionSuspended(sTransactionNumber), "Verifying The Transaction Is Suspended");
            LoggerUtility.StatusPass("Verified The Transaction Is Suspended");

            //VoidSuspendedTransaction
            Assert.True(Trans.VoidSuspendedTransaction(sTransactionNumber));
        }
        private static void crawlDataAndSaveData(DataTable dt)
        {
            DataTable updatedTable = new DataTable();

            updatedTable = dt.Clone();
            updatedTable.Columns.Add(OutputColumnEnum.PUB_DATE, typeof(DateTime));
            updatedTable.Columns.Add(OutputColumnEnum.TITLE, typeof(string));
            updatedTable.Columns.Add(OutputColumnEnum.SUB_HEADING, typeof(string));
            updatedTable.Columns.Add(OutputColumnEnum.SUMMARY, typeof(string));
            updatedTable.Columns.Add(OutputColumnEnum.WEB_URL, typeof(string));
            int totalRows = dt.Rows.Count;

            LoggerUtility.WriteLog("Total Rows to Crawl :", dt.Rows.Count.ToString());
            if (totalRows > 0)
            {
                for (int i = 0; i < totalRows; i++)
                {
                    DataRow dr = dt.Rows[i];
                    updatedTable.ImportRow(dr);
                    try
                    {
                        string companyCol = _inputFileConfig[InputFileConfigKeyEnum.COMPANY];
                        string company    = dr[companyCol].ToString();

                        string fromDateCol = _inputFileConfig[InputFileConfigKeyEnum.FROM_DATE];
                        string fromDate    = dr[fromDateCol].ToString();

                        string toDateCol = _inputFileConfig[InputFileConfigKeyEnum.TO_DATE];
                        string toDate    = dr[toDateCol].ToString();

                        try
                        {
                            List <Result> newsResult = ApiMananger.GetNewsList(company, fromDate, toDate);
                            foreach (var result in newsResult)
                            {
                                DataRow newsRow = updatedTable.NewRow();
                                newsRow[OutputColumnEnum.PUB_DATE]    = result.lifecycle?.lastPublishDateTime;
                                newsRow[OutputColumnEnum.SUB_HEADING] = result.editorial?.subheading;
                                newsRow[OutputColumnEnum.SUMMARY]     = result.summary?.excerpt;
                                newsRow[OutputColumnEnum.TITLE]       = result.title?.title;
                                newsRow[OutputColumnEnum.WEB_URL]     = result.location?.uri;
                                updatedTable.Rows.Add(newsRow);
                            }

                            ExcelManager.SaveDataTable(updatedTable);
                            LoggerUtility.WriteLog("Record Saved", (i + 1).ToString());
                        }
                        catch (Exception ex)
                        {
                            LoggerUtility.WriteLog("Error In Getting News for " + company + " - " + fromDate + " - " + toDate, ex.Message);
                        }
                    }
                    catch (Exception ex)
                    {
                        LoggerUtility.WriteLog("Error In Reading Row " + i, ex.Message);
                    }
                }
            }
        }
Ejemplo n.º 17
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IMemoryCache cache)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }
            //app.UseStaticFiles();
            var provider = new FileExtensionContentTypeProvider();

            provider.Mappings.Add(".exe", "application/vnd.microsoft.portable-executable"); //file ext, ContentType
            app.UseStaticFiles(new StaticFileOptions
            {
                ContentTypeProvider = provider
            });
            //localization
            var options = app.ApplicationServices.GetService <IOptions <RequestLocalizationOptions> >();

            app.UseRequestLocalization(options.Value);

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "ACBA Online Api v1");
            });

            //Request_Response logging
            Action <RequestProfilerModel> requestResponseHandler = requestProfilerModel =>
            {
                LoggerUtility.WriteRequestLog(requestProfilerModel, Configuration.GetConnectionString("AppLog"), !Convert.ToBoolean(Configuration["TestVersion"]), Convert.ToBoolean(Configuration["LogContentObject"]));
            };

            app.UseMiddleware <RequestResponseLoggingMiddleware>(requestResponseHandler);
            app.UseMvc();
            cache.Set("user", new User()
            {
                userID = Convert.ToInt16(Configuration["UserId"]), filialCode = 22000
            }, new MemoryCacheEntryOptions()
            {
                Priority = CacheItemPriority.NeverRemove
            });
            cache.Set("XBMuser", new XBManagement.User()
            {
                userID = Convert.ToInt16(Configuration["UserId"]), filialCode = 22000
            }, new MemoryCacheEntryOptions()
            {
                Priority = CacheItemPriority.NeverRemove
            });
            cache.Set("OperationServiceUser", new ACBAServiceReference.User()
            {
                userID = Convert.ToInt16(Configuration["UserId"]), filialCode = 22000
            }, new MemoryCacheEntryOptions()
            {
                Priority = CacheItemPriority.NeverRemove
            });
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Get the Current transaction number of the active transaction in Progress
        /// </summary>
        /// <returns>Transaction #</returns>
        public string GetCurrentTransactionNmbr()
        {
            Label  lblTransactionNumber = GetLabel(AppConstants.LBL_TRANS_NUM);
            string TransNumber          = lblTransactionNumber.Name.ToString();

            LoggerUtility.StatusInfo("The Current Transaction Number Is " + TransNumber);
            return(TransNumber);
        }
Ejemplo n.º 19
0
 public void AuthenticateEmployee(string sEmpNmbr, string sPasscode)
 {
     EnterEmployeeNumber(sEmpNmbr);
     EnterEmployeePasscode(sPasscode);
     Thread.Sleep(CommonData.iLoadingTime);
     wVStoreMainWindow.WaitWhileBusy();
     LoggerUtility.StatusInfo("Authenticated Employee Details");
 }
Ejemplo n.º 20
0
 public bool MergeTransaction()
 {
     ClickOnButton(ButtonConstants.BTN_PANEL_NEXT);
     //PressSpecialKey(KeyboardInput.SpecialKeys.F6);
     ClickOnButton(wVStoreMainWindow, ButtonConstants.BTN_TRANSACTION_MERGE);
     Thread.Sleep(1000);
     LoggerUtility.StatusInfo("Merging The Transaction");
     return(wMergeTransactionWin.Enabled);
 }
Ejemplo n.º 21
0
        public void SearchCustomersByName(string sFirstName, string sLastName)
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Cust.OpenCustomerWindow();
            Cust.SearchCustomerAndSelect(sFirstName, sLastName);
            Cust.CloseCustomerWindow();
        }
Ejemplo n.º 22
0
        //[Test]
        public void Test()
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Cust.OpenCustomerWindow();
            LoggerUtility.WriteLog(Cust.tblCustomerList.ToString());
            Cust.CloseCustomerWindow();
        }
Ejemplo n.º 23
0
 public void AuthenticateUser(string sEmpNmbr, string sPasscode)
 {
     EnterEmployeeNumber(sEmpNmbr);
     EnterEmployeePasscode(sPasscode);
     Thread.Sleep(1000);
     Console.WriteLine("<Info> The user authentication for the Emp: " + sEmpNmbr);
     wVStoreMainWindow.WaitWhileBusy();
     LoggerUtility.StatusInfo("Authenticated The Employee With The # " + sEmpNmbr);
 }
Ejemplo n.º 24
0
        //[Test]
        public void TestDBConnections()
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            DatabaseUtility dbUtil          = new DatabaseUtility();
            string          sCustomersCount = dbUtil.RetrieveFieldValueFromDB(CommonData.qCustomersCount, CommonData.sCustCountFieldName);

            LoggerUtility.StatusInfo("[" + sCustomersCount + "]");
        }
Ejemplo n.º 25
0
 public void Recover_Transactions()
 {
     testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
     LoggerUtility.StartTest(testName);
     Trans.SelectRecoverTransactions();
     Emp.AuthenticateEmployee(CommonData.EMP_ID, CommonData.EMP_PWD);
     Assert.True(VerifyAppState(StateConstants.STATE_460) || VerifyAppState(StateConstants.STATE_461));
     LoggerUtility.StatusPass("Verified Transaction States");
     Assert.True(Trans.NoTransactionToTransaferMessage() || Trans.SelectTransactionToTransaferMessage());
     ClickOnButton(wVStoreMainWindow, ButtonConstants.BTN_CANCEL);
 }
Ejemplo n.º 26
0
        public void SearchCustomersByPhoneOrEmail(string sPhoneOrEmail)
        {
            testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            LoggerUtility.StartTest(testName);

            Cust.OpenCustomerWindow();
            Assert.True(Cust.SearchCustomerAndSelect(sPhoneOrEmail));
            LoggerUtility.StatusPass("Verified The Customer Search And Set");

            Cust.CloseCustomerWindow();
        }
Ejemplo n.º 27
0
        public void EngineInitTest()
        {
            Engine        target = new Engine();
            PrivateObject obj    = new PrivateObject(target);

            target.Init(".\\TestConfig\\", "Test");

            LoggerUtility logger = (LoggerUtility)obj.GetFieldOrProperty("mLogger");

            Assert.IsTrue(logger.WarnMessages.Count == 1);
        }
Ejemplo n.º 28
0
 public static void SaveDataTable(DataTable updatedTable)
 {
     try
     {
         ExcelUtility.ExportToExcelOleDb(updatedTable, _sheetName, _outputFilePath, true);
     }
     catch (Exception ex)
     {
         LoggerUtility.WriteLog("Error in Writing Data", ex.Message);
     }
 }
 public void Initialize()
 {
     target          = new InputService();
     po              = new PrivateObject(target);
     logger          = new LoggerUtility("test");
     msgRouterMock   = new Mock <IMessageRouter>();
     execContextMock = new Mock <IExecutableContext>();
     handlerMock     = new Mock <IInputHandler>();
     execContextMock.Setup(f => f.MessageRouter).Returns(msgRouterMock.Object);
     po.SetFieldOrProperty("mLogger", logger);
     target.Init(execContextMock.Object);
 }
Ejemplo n.º 30
0
        public static void FilterCompaniesRecords()
        {
            var    dataSet        = ExcelUtilities.GetDataSetFromExcelFile(filePath, companiesRecordSheet);
            var    companiesTable = dataSet.Tables[companiesRecordSheet];
            var    filteredTable  = FilterDataTable(companiesTable);
            string outputFileName = "FilteredCompanyRecords.xlsx";

            ExcelUtilities.ExportToExcelOleDb(filteredTable, companiesRecordSheet, OutputFilePath, outputFileName, true);

            LoggerUtility.Write("Success", "Company Records Sorted " + OutputFilePath + outputFileName);
            APIManager.ParseCompaniesData(filteredTable);
        }