public void ModifyCustomerAccountByAccountNumberAndSiteId(
            string accountNumber, int siteID, string dateOfBirth,
            string driverLicenseNumber, string businessName,
            string title, string firstName,
            string lastName, string middleInitial, string homeTelephone,
            string businessTelephone, string otherTelephone,
            string socialSecurityNumber, string pin, string emailAddress,
            string comments, BlockPaymentSetting paymentSetting)
        {
            try
            {
#if (!STUBS)
                CustomerAccountManager customerAccountManager = new CustomerAccountManager(this.userName, siteID);

                customerAccountManager.ModifyCustomerAccountByAccountNumberAndSiteId(
                    accountNumber, siteID, dateOfBirth, driverLicenseNumber,
                    businessName,
                    title, firstName, lastName, middleInitial,
                    homeTelephone, businessTelephone, otherTelephone,
                    socialSecurityNumber, pin, emailAddress,
                    comments, paymentSetting);
#endif
            } // try
            catch (Exception exc)
            {
                ExceptionManager.Publish(exc);
                throw CoxSoapException.Create(exc);
            } // catch( Exception exc )
        }     // ModifyCustomerAccountByHouseNumberAndSiteId()
Пример #2
0
        public void WithdrawInvalidMoney()
        {
            mockCustomer.Setup(x => x.GetAccountBalance(It.IsAny <int>())).Returns((int d) => tblAccount.Where(y => y.AccountNumber == d).Single().Balance);

            mockCurrency.Setup(p => p.GetCurrency(It.IsAny <string>(), It.IsAny <string>())).Returns((string a, string b) =>
            {
                return(tblCurrency.Where(x => x.APICurrencyType == a && x.ExpectedCurrency == b).Single().CurrencyValue);
            });

            mockCustomer.Setup(p => p.UpdateBalance(It.IsAny <DAL.Models.Account>())).Returns((DAL.Models.Account acc) =>
            {
                tblAccount.Where(x => x.AccountNumber == acc.AccountNumber).FirstOrDefault().Balance = acc.Balance;
                return(true);
            });


            var balanceBeforeUpdate = tblAccount.Where(x => x.AccountNumber == 10001).FirstOrDefault().Balance;

            CustomerAccountManager obj = new CustomerAccountManager(MockCustomerAccountRepo, MockCurrencyRepo);
            var result = obj.Withdraw(10001, 4000, "USD", "USD");

            var balanceAfterUpdate = tblAccount.Where(x => x.AccountNumber == 10001).FirstOrDefault().Balance;

            Assert.AreEqual(result.Message, "Insufficient Money in your account");
        }
Пример #3
0
        public void DepositValidSameCurrency()
        {
            mockCustomer.Setup(x => x.GetAccountBalance(It.IsAny <int>())).Returns((int d) => tblAccount.Where(y => y.AccountNumber == d).Single().Balance);

            mockCurrency.Setup(p => p.GetCurrency(It.IsAny <string>(), It.IsAny <string>())).Returns((string a, string b) =>
            {
                return(tblCurrency.Where(x => x.APICurrencyType == a && x.ExpectedCurrency == b).Single().CurrencyValue);
            });

            mockCustomer.Setup(p => p.UpdateBalance(It.IsAny <DAL.Models.Account>())).Returns((DAL.Models.Account acc) =>
            {
                tblAccount.Where(x => x.AccountNumber == acc.AccountNumber).FirstOrDefault().Balance = acc.Balance;
                return(true);
            });


            var balanceBeforeUpdate = tblAccount.Where(x => x.AccountNumber == 10001).FirstOrDefault().Balance;

            CustomerAccountManager obj = new CustomerAccountManager(MockCustomerAccountRepo, MockCurrencyRepo);
            var result = obj.Deposit(10001, 100, "USD", "USD");

            var balanceAfterUpdate = tblAccount.Where(x => x.AccountNumber == 10001).FirstOrDefault().Balance;

            Assert.IsTrue(balanceAfterUpdate > balanceBeforeUpdate);
            Assert.AreEqual(result.Balance, balanceAfterUpdate);
            Assert.AreEqual(result.Message, "Processed Succcessful");
        }
        public string CreateRoommateAccountByAccountNumberAndSiteId(string accountNumber9
                                                                    , int siteId
                                                                    , string firstName
                                                                    , string lastName
                                                                    , string middleInitial
                                                                    , string title
                                                                    , string dateOfBirth
                                                                    , string driverLicenseNumber
                                                                    , string socialSecurityNumber
                                                                    , string businessName
                                                                    , string homeTelephone
                                                                    , string businessTelephone
                                                                    , string otherTelephone
                                                                    , string pin
                                                                    , string emailAddress
                                                                    , string comments
                                                                    , string complex
                                                                    , AuditCheckCode auditCheckCode
                                                                    , CableServiceStatus cableServiceStatus)
        {
            //account number to be returned
            string accountNumber = string.Empty;

            try
            {
#if (!STUBS)
                CustomerAccountManager customerAccountManager = new CustomerAccountManager(this.userName, siteId);

                accountNumber = customerAccountManager.CreateRoommateAccountByAccountNumberAndSiteId(accountNumber9
                                                                                                     , siteId
                                                                                                     , firstName
                                                                                                     , lastName
                                                                                                     , middleInitial
                                                                                                     , title
                                                                                                     , dateOfBirth
                                                                                                     , driverLicenseNumber
                                                                                                     , socialSecurityNumber
                                                                                                     , businessName
                                                                                                     , homeTelephone
                                                                                                     , businessTelephone
                                                                                                     , otherTelephone
                                                                                                     , pin
                                                                                                     , emailAddress
                                                                                                     , comments
                                                                                                     , complex
                                                                                                     , auditCheckCode
                                                                                                     , cableServiceStatus);
#endif
            }//try
            catch (Exception exc)
            {
                ExceptionManager.Publish(exc);
                throw CoxSoapException.Create(exc);
            } // catch( Exception exc )

            return(accountNumber);
        }//CreateRoommateAccountByAccountNumberAndSiteId()
Пример #5
0
        public void ShowBalanceinCongiguredCurrency()
        {
            mockCustomer.Setup(x => x.GetAccountBalance(It.IsAny <int>())).Returns((int d) => tblAccount.Where(y => y.AccountNumber == d).Single().Balance);

            mockCurrency.Setup(p => p.GetCurrency(It.IsAny <string>(), It.IsAny <string>())).Returns((string a, string b) =>
            {
                return(tblCurrency.Where(x => x.APICurrencyType == a && x.ExpectedCurrency == b).Single().CurrencyValue);
            });

            CustomerAccountManager obj = new CustomerAccountManager(MockCustomerAccountRepo, MockCurrencyRepo);
            var result         = obj.GetCurrencyAccountBalance(10001, "USD", "USD");
            var ExpectedResult = tblAccount.Where(x => x.AccountNumber == 10001).FirstOrDefault().Balance;

            Assert.AreEqual(ExpectedResult, result.Balance);
        }