private void GetCloseAccountOptions(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService .GetCloseAccountOptions(Arg.Is <GetClsAccountOptsRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687C")) .Returns(new GetClsAccountOptsResponse { CloseAccountOptions = new List <string> { "Spend Down", "Refund" } }); cRMCoreAccountService.When(m => m.GetCloseAccountOptions(Arg.Is <GetClsAccountOptsRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687D"))) .Do( x => { throw new ArgumentException(); }); cRMCoreAccountService.When(m => m.GetCloseAccountOptions(Arg.Is <GetClsAccountOptsRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687E"))) .Do( x => { throw new GdErrorException( "Error while executing GetAccountStatusReason"); }); cRMCoreAccountService .GetCloseAccountOptions(Arg.Is <GetClsAccountOptsRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687F")) .Returns((GetClsAccountOptsResponse)null); }
private static void GetMonthlyStatementDate(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetMonthlyStatementDate(Arg.Is <string>(p => p == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD1")) .Returns( new AvailableDates() { StartDate = "2017-01-01", EndDate = "2017-07-01" }); cRMCoreAccountService.GetMonthlyStatementDate( Arg.Is <string>(m => m == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD5")) .Returns((AvailableDates)null); cRMCoreAccountService.When( m => m.GetMonthlyStatementDate(Arg.Is <string>(p => p == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD6"))) .Do( x => { throw new GdErrorException( "Error while executing GetMonthlyStatementDate A9DFB55A-2FF9-4D79-B666-04892FBC9CD6"); }); cRMCoreAccountService.When( m => m.GetMonthlyStatementDate(Arg.Is <string>(p => p == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD7"))) .Do( x => { throw new Exception("Error while executing GetMonthlyStatementDate A9DFB55A-2FF9-4D79-B666-04892FBC9CD7"); }); }
private static void GetFullSSN(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetSSNBySSNToken(Arg.Is <GetSSNBySSNTokenRequest>(p => p.SSNToken == "0PTTLVH7WJZ")) .Returns(new GetSSNBySSNTokenResponse { SSN = "123456789" }); cRMCoreAccountService.GetSSNBySSNToken(Arg.Is <GetSSNBySSNTokenRequest>(p => p.SSNToken == "1PTTLVH7WJZ")) .Returns((GetSSNBySSNTokenResponse)null); cRMCoreAccountService.When( m => m.GetSSNBySSNToken(Arg.Is <GetSSNBySSNTokenRequest>(p => p.SSNToken == "2PTTLVH7WJZ"))) .Do( x => { throw new GdErrorException( "Error while executing GetFullSSN 2PTTLVH7WJZ"); } ); cRMCoreAccountService.When( m => m.GetSSNBySSNToken(Arg.Is <GetSSNBySSNTokenRequest>(p => p.SSNToken == "3PTTLVH7WJZ"))) .Do( x => { throw new ArgumentException(); } ); }
private void UpdateAccountStatusReason(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.UpdAccountStatusReason(Arg.Is <UpdAccountStatusReasonRequest>(p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687C")) .Returns(Task.Run(() => { })); cRMCoreAccountService.When( m => m.UpdAccountStatusReason(Arg.Is <UpdAccountStatusReasonRequest>(p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687D"))) .Do( x => { throw new GdErrorException( "Error while executing UpdAccountStatusReason"); }); cRMCoreAccountService.When( m => m.UpdAccountStatusReason(Arg.Is <UpdAccountStatusReasonRequest>(p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687E"))) .Do( x => { throw new ArgumentException(); }); }
private static void ReversePendingAuthorizationTransaction(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.ReverseAuthorization(Arg.Is <ReverseAuthorizationRequest>(p => p.AuthorizedTransactionKey == 1)) .Returns(Task.Run(() => { })); cRMCoreAccountService.When( m => m.ReverseAuthorization(Arg.Is <ReverseAuthorizationRequest>(p => p.AuthorizedTransactionKey == 2))) .Do( x => { throw new GdErrorException( "Error while executing ReverseAuthorization AuthorizedTransactionKey == 2"); }); cRMCoreAccountService.When( m => m.ReverseAuthorization(Arg.Is <ReverseAuthorizationRequest>(p => p.AuthorizedTransactionKey == 3))) .Do( x => { throw new ArgumentException(); }); }
private void GetAccountStatusReason(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService .GetStatusTransition(Arg.Is <GetStatusTransitionRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687C")) .Returns(new GetStatusTransitionResponse { CurrentStatus = "Active", CurrentStatusReason = null, TargetStatuses = new List <string> { "Restricted", "Locked" }, ReasonKey = 54, StatusReason = "Agent Manual Review", }); cRMCoreAccountService.When(m => m.GetStatusTransition(Arg.Is <GetStatusTransitionRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687D"))) .Do( x => { throw new ArgumentException(); }); cRMCoreAccountService.When(m => m.GetStatusTransition(Arg.Is <GetStatusTransitionRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687E"))) .Do( x => { throw new GdErrorException( "Error while executing GetAccountStatusReason"); }); cRMCoreAccountService .GetStatusTransition(Arg.Is <GetStatusTransitionRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687F")) .Returns((GetStatusTransitionResponse)null); }
/// <summary> /// 5 status: /// Success /// ExternalErrorException /// Exception /// GdErrorException /// NotFoundException /// </summary> /// <param name="cRMCoreAccountService"></param> private void GetTransType(ICRMCoreService cRMCoreAccountService) { // Success cRMCoreAccountService .GetAllTransType(Arg.Is <CareGateway.External.Model.Request.GetAllTransTypeRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687C")) .Returns(new CareGateway.External.Model.Response.GetAllTransTypeResponse { listTransType = new List <CareGateway.External.Model.Data.TransType>() { new CareGateway.External.Model.Data.TransType() { TransCodeDescription = "Balance Transfer FUNDING", GDTransCode = 1, TransCodeCreditDebit = "C", GDTransactionClass = "108-004" }, new CareGateway.External.Model.Data.TransType() { TransCodeDescription = "Customer Courtesy", GDTransCode = 2, TransCodeCreditDebit = "C", GDTransactionClass = "108-005" }, new CareGateway.External.Model.Data.TransType() { TransCodeDescription = "Balance Inquiry Fee", GDTransCode = 4, TransCodeCreditDebit = "D", GDTransactionClass = "108-006" }, new CareGateway.External.Model.Data.TransType() { TransCodeDescription = "Lost/Stolen Repl Card Fee", GDTransCode = 5, TransCodeCreditDebit = "D", GDTransactionClass = "108-007" } } }); // ExternalError cRMCoreAccountService.When(m => m.GetAllTransType(Arg.Is <CareGateway.External.Model.Request.GetAllTransTypeRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687D"))) .Do( x => { throw new ExternalErrorException("Error when calling GetAllTransType method from CRMCoreService"); }); // Exception cRMCoreAccountService.When(m => m.GetAllTransType(Arg.Is <CareGateway.External.Model.Request.GetAllTransTypeRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687E"))) .Do( x => { throw new ArgumentException(); }); // GdErrorException cRMCoreAccountService.When(m => m.GetAllTransType(Arg.Is <CareGateway.External.Model.Request.GetAllTransTypeRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687F"))) .Do( x => { throw new GdErrorException("Error while executing GetAllTransType"); }); // NotFound cRMCoreAccountService .GetAllTransType(Arg.Is <CareGateway.External.Model.Request.GetAllTransTypeRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687G")) .Returns((CareGateway.External.Model.Response.GetAllTransTypeResponse)null); }
private void CloseAccount(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService .CloseAccount(Arg.Is <CareGateway.External.Model.Request.CloseAccountRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687C")) .Returns(new CareGateway.External.Model.Response.CloseAccountResponse() { ResponseHeader = new ResponseHeader() { StatusCode = HttpStatusCode.OK.ToString() }, Account = new Account() { AccountId = new Guid("18204E5C-C243-4096-8BC2-3A62E49B687C"), AccountKey = 1000011, AccountStatusReasonKeys = new int[] { 1, 2 }, Balance = new Balance() { Actual = 100001, Available = 1000001, }, Bin = "Bin1", CreateDate = "2017/01/01", Cure = "Cure1", CurrencyCode = "CurrencyCode1", DBStage = Stage.Identified, EventCounter = 10001, Identifier = "Identifier1", Pod = "Pod1", ReasonCodes = new String[] { "01", "001" }, Stage = Stage.Identified, State = State.Closed, Status = new AccountStatus() { Kyc = Status.Pending, Ofac = Status.Success } } }); cRMCoreAccountService .CloseAccount(Arg.Is <CareGateway.External.Model.Request.CloseAccountRequest> (p => p.AccountIdentifier == "28204E5C-C243-4096-8BC2-3A62E49B687C")) .Returns(new CareGateway.External.Model.Response.CloseAccountResponse() { ResponseHeader = new ResponseHeader() { StatusCode = HttpStatusCode.OK.ToString() }, Account = null }); cRMCoreAccountService.When( m => m.CloseAccount(Arg.Is <CareGateway.External.Model.Request.CloseAccountRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687D"))) .Do( x => { throw new Exception(); }); cRMCoreAccountService.When( m => m.CloseAccount(Arg.Is <CareGateway.External.Model.Request.CloseAccountRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687E"))) .Do( x => { throw new GdErrorException( "Error while executing CloseAccount"); }); cRMCoreAccountService .CloseAccount(Arg.Is <CareGateway.External.Model.Request.CloseAccountRequest> (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687F")) .Returns((CareGateway.External.Model.Response.CloseAccountResponse)null); }
private static void AccountSearchByCustomerInfo(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetCustomerInfoByCustomerDetail(Arg.Is <SearchAccountByDetailRequest>(p => p.FirstName == "FirstName1")) .Returns(new List <CustomerInfo> { new CustomerInfo() { FirstName = "FirstName1", Last4SSN = "1234", LastName = "LastName1", AccountIdentifier = "A9DFB55A-2FF9-4D79-B666-04892FBC9CD1", AccountState = "Closed", AccountNumber = "111111111" }, new CustomerInfo() { FirstName = "FirstName1", Last4SSN = "1234", LastName = "LastName1", AccountIdentifier = "B9DFB55A-2FF9-4D79-B666-04892FBC9CD1", AccountState = "Active", AccountNumber = "211111111" } }); cRMCoreAccountService.GetCustomerInfoByCustomerDetail(Arg.Is <SearchAccountByDetailRequest>(p => p.LastName == "LastName2")) .Returns(new List <CustomerInfo> { new CustomerInfo() { FirstName = "FirstName2", Last4SSN = "1232", LastName = "LastName2", AccountIdentifier = "A9DFB55A-2FF9-4D79-B666-04892FBC9CD2", AccountState = "Active", AccountNumber = "111111112" } }); cRMCoreAccountService.GetCustomerInfoByCustomerDetail(Arg.Is <SearchAccountByDetailRequest>(p => p.DOB == "2017-01-15")) .Returns(new List <CustomerInfo> { new CustomerInfo() { FirstName = "FirstName3", Last4SSN = "1233", LastName = "LastName3", AccountIdentifier = "A9DFB55A-2FF9-4D79-B666-04892FBC9CD3", AccountState = "Active", AccountNumber = "111111113" } }); cRMCoreAccountService.GetCustomerInfoByCustomerDetail(Arg.Is <SearchAccountByDetailRequest>(p => p.ZipCode == "ZipCode4")) .Returns(new List <CustomerInfo> { new CustomerInfo() { FirstName = "FirstName4", Last4SSN = "1234", LastName = "LastName4", AccountIdentifier = "A9DFB55A-2FF9-4D79-B666-04892FBC9CD4", AccountState = "Active", AccountNumber = "111111114" } }); cRMCoreAccountService.GetCustomerInfoByCustomerDetail( Arg.Is <SearchAccountByDetailRequest>(m => m.FirstName == "FirstName5")) .Returns((List <CustomerInfo>)null); cRMCoreAccountService.When( m => m.GetCustomerInfoByCustomerDetail(Arg.Is <SearchAccountByDetailRequest>(p => p.LastName == "LastName6"))) .Do( x => { throw new GdErrorException( "Error while executing GetCustomerInfoByCustomerDetail LastName6"); }); cRMCoreAccountService.When( m => m.GetCustomerInfoByCustomerDetail(Arg.Is <SearchAccountByDetailRequest>(p => p.FirstName == "LastName7"))) .Do( x => { throw new Exception("Error while executing GetCustomerInfoByCustomerDetail LastName7"); }); }
private static void AccountSearchByAccountNumber(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetCustomerInfoByAccountNumber(Arg.Is <string>(p => p == "123456789")) .Returns(new List <CustomerInfo> { new CustomerInfo() { FirstName = "FirstName", Last4SSN = "1234", LastName = "LastName", AccountIdentifier = "A9DFB55A-2FF9-4D79-B666-04892FBC9CD1", AccountState = "Closed", AccountNumber = "111111111" }, new CustomerInfo() { FirstName = "FirstName1", Last4SSN = "1234", LastName = "LastName1", AccountIdentifier = "B9DFB55A-2FF9-4D79-B666-04892FBC9CD1", AccountState = "Active", AccountNumber = "211111111" } }); cRMCoreAccountService.GetCustomerInfoByAccountNumber(Arg.Is <string>(p => p == "123456782")) .Returns(new List <CustomerInfo> { new CustomerInfo() { FirstName = "FirstName2", Last4SSN = "1232", LastName = "LastName2", AccountIdentifier = "A9DFB55A-2FF9-4D79-B666-04892FBC9CD2", AccountState = "Active", AccountNumber = "111111112" } }); cRMCoreAccountService.GetCustomerInfoByAccountNumber( Arg.Is <string>(p => p == "123456783")) .Returns((List <CustomerInfo>)null); cRMCoreAccountService.When( m => m.GetCustomerInfoByAccountNumber(Arg.Is <string>(p => p == "123456784"))) .Do( x => { throw new GdErrorException( "Error while executing GetCustomerInfoBySSN 123456784"); }); cRMCoreAccountService.When( m => m.GetCustomerInfoByAccountNumber(Arg.Is <string>(p => p == "123456785"))) .Do( x => { throw new Exception("Error while executing GetCustomerInfoBySSN 123456785"); }); }
private static void GetAccountDetail(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetAccountDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")) .Returns(new AccountDetail() { State = "State 1", Stage = "Stage 1", Association = "Association 1", CardExternalID = "1111111", AccountExternalID = "111111", Cure = "Cure 1", Processor = "Preocessor 1", Reason = "Reason", AccountNumber = "1111111111" }); cRMCoreAccountService.GetAccountDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2")) .Returns(new AccountDetail() { State = "State 2", Stage = "Stage 2", Association = "Association 2", CardExternalID = "1111112", AccountExternalID = "111112", Cure = "Cure 2", Processor = "Preocessor 2", AccountNumber = "1111111112" }); cRMCoreAccountService.GetAccountDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")) .Returns(new AccountDetail() { State = "State 3", Stage = "Stage 3", Association = "Association 3", AccountExternalID = "111113", Cure = "Cure 3", Processor = "Preocessor 3", Reason = "Reason", AccountNumber = "1111111113" }); cRMCoreAccountService.GetAccountDetail( Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA87")) .Returns((AccountDetail)null); cRMCoreAccountService.When( m => m.GetAccountDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA89"))) .Do( x => { throw new GdErrorException( "Error while executing GetCustomerDetail 04C9E5B5716A43C2B55DD4B351C0AA89"); }); cRMCoreAccountService.When( m => m.GetAccountDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA88"))) .Do( x => { throw new Exception("Error while executing GetAccountDetail 04C9E5B5716A43C2B55DD4B351C0AA88"); }); }
private static void GetCustomerDetail(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetCustomerDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")) .Returns(new CustomerDetail() { Address = new Address() { Address1 = "Address1", Address2 = "Address2", City = "City 1", Country = "Country1", ZipCode = "ZipCode 1", State = "State 1", County = "County 1" }, AccountExternalID = "111111", DOB = "2017/05/10", FirstName = "Roman", MiddleName = "MiddleName1", LastName = "Zhang", Last4SSN = "1231", SSNToken = "123456", CreateDate = DateTime.Now.AddMonths(-1).Date }); cRMCoreAccountService.GetCustomerDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2")) .Returns(new CustomerDetail() { AccountExternalID = "111112", DOB = "2017/05/10", FirstName = "Roman", MiddleName = "", LastName = "Zhang", Last4SSN = "1232", SSNToken = "123456", CreateDate = DateTime.Now.AddMonths(-2).Date }); cRMCoreAccountService.GetCustomerDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")) .Returns(new CustomerDetail() { Address = new Address() { City = "City 3", Country = "Country3", ZipCode = "ZipCode 3", State = "State 3", County = "County 3" }, AccountExternalID = "111113", DOB = "2017/05/10", FirstName = "Roman", LastName = "Zhang", Last4SSN = "1233", SSNToken = "123456" }); cRMCoreAccountService.GetCustomerDetail( Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA87")) .Returns((CustomerDetail)null); cRMCoreAccountService.When( m => m.GetCustomerDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA89"))) .Do( x => { throw new GdErrorException( "Error while executing GetCustomerDetail 04C9E5B5716A43C2B55DD4B351C0AA89"); }); cRMCoreAccountService.When( m => m.GetCustomerDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA88"))) .Do( x => { throw new Exception("Error while executing GetCustomerDetail 04C9E5B5716A43C2B55DD4B351C0AA88"); }); }
private static void GetAccountSummary(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetAccountSummary(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")) .Returns(new AccountInfo() { AvailableBalance = 10, AccountStage = "Stage 01", AccountState = "State 01", DOB = "2017/05/10", FirstName = "Roman", LastName = "Zhang", Last4SSN = "1231", CareReason = "Reason 1", SSNToken = "SSNToken1" }); cRMCoreAccountService.GetAccountSummary(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2")) .Returns(new AccountInfo() { AvailableBalance = -10, AccountStage = "Stage 02", AccountState = "State 02", FirstName = "Roman", LastName = "Zhang", Last4SSN = "1232", SSNToken = "SSNToken2" }); cRMCoreAccountService.GetAccountSummary(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")) .Returns(new AccountInfo() { AvailableBalance = 10, AccountStage = "Stage 03", AccountState = "State 03", DOB = "2017/05/10", Last4SSN = "1233", SSNToken = "SSNToken3" }); cRMCoreAccountService.GetAccountSummary( Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA87")) .Returns((AccountInfo)null); cRMCoreAccountService.When( m => m.GetAccountSummary(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA89"))) .Do( x => { throw new GdErrorException( "Error while executing GetAccountSummary 04C9E5B5716A43C2B55DD4B351C0AA89"); }); cRMCoreAccountService.When( m => m.GetAccountSummary(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA88"))) .Do( x => { throw new Exception("Error while executing GetAccountSummary 04C9E5B5716A43C2B55DD4B351C0AA88"); }); }
private static void GetAllTransactionHistory(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetAllTransactionHistory( Arg.Is <GetAllTransactionHistoryReqeust>( p => p.AccountIdentifier == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")) .Returns(new List <CareGateway.External.Model.Data.Transaction>() { new CareGateway.External.Model.Data.Transaction() { Summary = new TransactionSummary() { TransactionIdentifier = "9177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1", AuthorizedTransactionKey = 1, AvailableBalance = 10, IsCredit = true, IsReversible = true, TransactionAmount = 10, TransactionDate = "2017/01/01", TransactionDescription = "TransactionDescription1", TransactionStatus = "TransactionStatus1", TransType = "TransType", }, Detail = new TransactionDetail() { AccountGUID = "3F1E05AD-A52D-4A43-B3AA-C5B5D0B6D149", AccountProxy = "11111111", AchOutCardholderCompleteName = "AchOutName", AchOutTargetAccountNumber = "AchOutAN", AchOutOriginalRequestID = "AchOutOriginalRequestID", AchOutTargetAccountRoutingNumber = "AchOutTargetAccountRoutingNumber", AnotherSourceAccountAmount = 10, AnotherSourceAccountType = "AnotherSourceAccountType", AnotherSourceAmountFee = 10, ApprovalCode = "ApprovalCode", AuthorizationAmount = 10, AuthorizationDate = "217/01/01", AuthorizationReleaseDate = "217/01/01", ConversionRate = 1, DeclineCode = "DeclineCode1", DeclineReason = "DeclineReason1", MCCCode = "MCCCode1", MCCCategory = "MCCCategory1", MerchantLocation = "MerchantLocation", P2PGrandTotal = 10, P2PRecipientName = "P2PRecipientName1", P2PSenderName = "P2PSenderName1", P2PType = "P2PType1", ReceiptStatus = "ReceiptStatus1", TopUpCardType = "TopUpCardType1", TopUpCardFee = 10, TransactionCodeDescription = "TransactionCodeDescription1", WalletID = "WalletID1", ARN = "ARN1" } }, new CareGateway.External.Model.Data.Transaction() { Summary = new TransactionSummary() { TransactionIdentifier = "9177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2", AuthorizedTransactionKey = 2, AvailableBalance = 10, IsCredit = false, IsReversible = false, TransactionAmount = 12, TransactionDate = "2017/01/02", TransactionStatus = "TransactionStatus2", TransactionDescription = "TransactionDescription2", TransType = "TransType2", }, Detail = new TransactionDetail() { AccountGUID = "3F1E05AD-A52D-4A43-B3AA-C5B5D0B6D149", AccountProxy = "11111112", AchOutCardholderCompleteName = "AchOutName2", AchOutTargetAccountNumber = "AchOutAN2", AchOutOriginalRequestID = "AchOutOriginalRequestID2", AchOutTargetAccountRoutingNumber = "AchOutTargetAccountRoutingNumber2", AnotherSourceAccountAmount = 12, AnotherSourceAccountType = "AnotherSourceAccountType2", AnotherSourceAmountFee = 12, ApprovalCode = "ApprovalCode2", AuthorizationAmount = 12, AuthorizationDate = "217/01/02", AuthorizationReleaseDate = "217/01/02", ConversionRate = 2, DeclineCode = "DeclineCode2", DeclineReason = "DeclineReason2", MCCCode = "MCCCode2", MCCCategory = "MCCCategory2", MerchantLocation = "MerchantLocation2", P2PGrandTotal = 12, P2PRecipientName = "P2PRecipientName2", P2PType = "P2PType2", ReceiptStatus = "ReceiptStatus2", TopUpCardType = "TopUpCardType2", TopUpCardFee = 10, TransactionCodeDescription = "TransactionCodeDescription2", WalletID = "WalletID2", ARN = "ARN1" } } }); cRMCoreAccountService.GetAllTransactionHistory( Arg.Is <GetAllTransactionHistoryReqeust>( p => p.AccountIdentifier == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")) .Returns(new List <CareGateway.External.Model.Data.Transaction>() { new CareGateway.External.Model.Data.Transaction() { Summary = new TransactionSummary() { TransactionIdentifier = "9177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1", AuthorizedTransactionKey = 2, AvailableBalance = 10, IsCredit = true, IsReversible = true, TransactionAmount = 10, TransactionDate = "2017/01/01", TransactionStatus = "TransactionStatus1", TransType = "TransType", }, Detail = new TransactionDetail() { AccountGUID = "3F1E05AD-A52D-4A43-B3AA-C5B5D0B6D149", AccountProxy = "11111111", AchOutCardholderCompleteName = "AchOutName", AnotherSourceAccountType = "AnotherSourceAccountType", AnotherSourceAmountFee = 10, ApprovalCode = "ApprovalCode", AuthorizationAmount = 10, AuthorizationDate = "217/01/01", AuthorizationReleaseDate = "217/01/01", MCCCode = "MCCCode1", MCCCategory = "MCCCategory1", MerchantLocation = "MerchantLocation", P2PGrandTotal = 10, P2PRecipientName = "P2PRecipientName1", TransactionCodeDescription = "TransactionCodeDescription1", WalletID = "WalletID1", ARN = "ARN1" } } }); cRMCoreAccountService.GetAllTransactionHistory( Arg.Is <GetAllTransactionHistoryReqeust>( p => p.AccountIdentifier == "04C9E5B5716A43C2B55DD4B351C0AA87")) .Returns((List <CareGateway.External.Model.Data.Transaction>)null); cRMCoreAccountService.When( m => m.GetAllTransactionHistory( Arg.Is <GetAllTransactionHistoryReqeust>( p => p.AccountIdentifier == "04C9E5B5716A43C2B55DD4B351C0AA89"))) .Do( x => { throw new GdErrorException( "Error while executing GetAccountSummary 04C9E5B5716A43C2B55DD4B351C0AA89"); }); cRMCoreAccountService.When( m => m.GetAllTransactionHistory( Arg.Is <GetAllTransactionHistoryReqeust>( p => p.AccountIdentifier == "04C9E5B5716A43C2B55DD4B351C0AA88"))) .Do( x => { throw new Exception("Error while executing GetAccountSummary 04C9E5B5716A43C2B55DD4B351C0AA88"); }); }