Esempio n. 1
0
        //This method will very the details in Trade Report tab TC_33
        public Dictionary <string, string> SubmitBuyTradeReport(string instrument, string buyTab, string counterPartyValue, string productBoughtPrice, string productSoldPrice, string status)
        {
            try
            {
                Dictionary <string, string> placeBlockTradeReportOrder = new Dictionary <string, string>();
                var blockTradePrice = GetBlockTradePrice(productBoughtPrice, productSoldPrice);
                SubmitReportButton();
                string feeValueText = LabelConfirmBlockTradeFeeValue().Text;
                placeBlockTradeReportOrder = VerifyConfirmBlockTradeElements(counterPartyValue, instrument);
                VerifyFinalAmountAndFinalValue();
                ConfirmSubmitReportButton();
                string expectedBuyTradeReportOrderMsg = BuyTradeReportOrderMsg().Text;
                string actualCancelMsg = UserCommonFunctions.GetTextOfMessage(driver, logger);

                string actualBuyTradeReportOrderMsg = string.Format(LogMessage.BuyTradeReportOrderMesgSuccess);
                string expectedCancelMsg            = string.Format(LogMessage.BuyTradeReportOrderMesgCanceled);
                try
                {
                    Assert.Equal(expectedBuyTradeReportOrderMsg, actualBuyTradeReportOrderMsg);
                    logger.LogCheckPoint(string.Format(LogMessage.BuyTradeReportOrderMesgSuccess));
                }
                catch (Exception)
                {
                    logger.LogCheckPoint(string.Format(LogMessage.BuyTradeReportOrderMesgCanceled));
                }
                Thread.Sleep(2000);
                UserSetFunctions.Click(CloseReportBlockTradeWindowSection());
                try
                {
                    VerifyOrdersTab objVerifyOrdersTab = new VerifyOrdersTab(driver, logger);
                    objVerifyOrdersTab.VerifyTradeReportsTab(instrument, buyTab, productBoughtPrice, blockTradePrice, feeValueText, placeBlockTradeReportOrder["PlaceBlockTradeTime"], placeBlockTradeReportOrder["PlaceBlockTradeTimePlusOneMin"], status);
                    logger.LogCheckPoint(String.Format(LogMessage.BuyBlockTradeReportTestPassed, buyTab));
                }
                catch (Exception)
                {
                    logger.LogCheckPoint(String.Format(LogMessage.BuyBlockTradeReportTestFailed, buyTab));
                }

                try
                {
                    Thread.Sleep(2000);
                    if (CancelButton().Enabled)
                    {
                        logger.LogCheckPoint(string.Format(LogMessage.VerifiedCancelButtonFailed));
                    }
                }
                catch (Exception)
                {
                    logger.LogCheckPoint(string.Format(LogMessage.VerifiedCancelButtonPassed));
                }

                Thread.Sleep(2000);
                return(placeBlockTradeReportOrder);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 2
0
        //This method will verify the Block Trade Trade Report of Other Party
        public void VerifyOtherPartyBlockTradeReportTab(string instrument, string sellTab, string counterPartyValue, string productBoughtPrice, string productSoldPrice, string status, Dictionary <string, string> otherPartyBlockTradeData)
        {
            OrderEntryPage orderEntryPage  = new OrderEntryPage(driver, logger);
            string         lastPrice       = orderEntryPage.GetLastPrice();
            var            blockTradePrice = GetBlockTradePrice(productBoughtPrice, productSoldPrice);
            double         feeValue        = (Double.Parse(productBoughtPrice) * Double.Parse(lastPrice)) / 25;
            string         feeValueText    = GenericUtils.ConvertToDoubleFormat(feeValue);

            try
            {
                VerifyOrdersTab objVerifyOrdersTab = new VerifyOrdersTab(driver, logger);
                objVerifyOrdersTab.VerifyTradeReportsTab(instrument, sellTab, productBoughtPrice, blockTradePrice, feeValueText, otherPartyBlockTradeData["PlaceBlockTradeTime"], otherPartyBlockTradeData["PlaceBlockTradeTimePlusOneMin"], status);
                logger.LogCheckPoint(String.Format(LogMessage.SellBlockTradeReportTestPassed, sellTab));
            }
            catch (Exception)
            {
                logger.LogCheckPoint(String.Format(LogMessage.SellBlockTradeReportTestFailed, sellTab));
            }
        }