Esempio n. 1
0
        /// <summary>
        /// Checks is amount in the first transaction equals expected (front - transactions)
        /// </summary>
        /// <param name="expectedAmount"></param>
        /// <param name="email">User's email to log in</param>
        /// <param name="password">User's password</param>
        /// <param name="numberOfRecord">Which record to check, the first one or the second one</param>
        public void CheckAmountInTransaction_Front(double expectedAmount, string email, string password, int numberOfRecord = 1)
        {
            _commonActions.Log_In_Front_PageOne(email, password);
            _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/account/balance/");
            TransactionObj transaction = new TransactionObj(_driver);

            if (numberOfRecord == 1)
            {
                Assert.AreEqual(expectedAmount, transaction.FirstRecordAmount,
                    "Sorry, but the amount of the first record is not as expected. Page: " + _driverCover.Driver.Url +
                    " ");
            }

            if (numberOfRecord == 2)
            {
                Assert.AreEqual(expectedAmount, transaction.SecondRecordAmount,
                    "Sorry, but the amount of the first record is not as expected. Page: " + _driverCover.Driver.Url +
                    " ");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Checks lottery name of the first and the second records in user's account - transactions in the front-end
        /// </summary>
        /// <param name="name"></param>
        /// <param name="email">User's email to log in</param>
        /// <param name="password">User's password</param>
        /// <param name="numberOfRecord">Which record to check, the first one or the second one</param>
        public void CheckTransactionLotteryName_Front(string name, string email, string password, int numberOfRecord = 1)
        {
            _commonActions.Log_In_Front_PageOne(email, password);
            _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/account/balance/");
            TransactionObj myTransactions = new TransactionObj(_driver);

            if (numberOfRecord == 1)
            {
                Assert.AreEqual(name, myTransactions.FirstRecordLottery, "The first record has different lottery name, please check it, page: " +
                                  _driverCover.Driver.Url + " ");
            }

            if (numberOfRecord == 2)
            {
                Assert.AreEqual(name, myTransactions.SecondRecordLottery, "The second record has different lottery name, please check it, page: " +
                                  _driverCover.Driver.Url + " ");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Checks date of the first and seconds records in users account - transactions (front-end)
        /// </summary>
        /// <param name="email">User's email to log in</param>
        /// <param name="password">User's password</param>
        /// <param name="numberOfRecord">Which record to check, the first one or the second one</param>
        public void CheckTransactionDate_Front(string email, string password, int numberOfRecord = 1)
        {
            _commonActions.Log_In_Front_PageOne(email, password);
            _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/account/balance/");
            TransactionObj myTransactions = new TransactionObj(_driver);

            //make month to be in right format
            string digit = DateTime.Now.Month.ToString(System.Globalization.CultureInfo.InvariantCulture);
            string month;
            if (digit.Length == 1)
                month = "0" + digit;
            else
                month = digit;

            //make day to be in right format
            digit = DateTime.Now.Day.ToString(System.Globalization.CultureInfo.InvariantCulture);
            string day;
            if (digit.Length == 1)
                day = "0" + digit;
            else
                day = digit;

            string date = day + "/" + month + "/" + DateTime.Now.Year;

            if (numberOfRecord == 1)
            {
                Assert.AreEqual(date, myTransactions.FirstRecordDate, "The first record doesn't have current date, please check it, page: " +
                                  _driverCover.Driver.Url + " ");
            }

            if (numberOfRecord == 2)
            {
                Assert.AreEqual(date, myTransactions.SecondRecordDate, "The second record doesn't have current date, please check it, page: " +
                                  _driverCover.Driver.Url + " ");
            }
        }