internal BankAccountDetails GiveAccountDetails(SingleAccountInfo selectedAccountInfo) { WebRequestComms sComms = new WebRequestComms(); CommunicationModule comms = new CommunicationModule(sComms); return comms.GiveAccountDetails(selectedAccountInfo); }
internal BankAccountDetails GiveAccountDetails(SingleAccountInfo selectedAccountInfo) { WebRequestComms sComms = new WebRequestComms(); CommunicationModule comms = new CommunicationModule(sComms); return(comms.GiveAccountDetails(selectedAccountInfo)); }
internal BankCommsCapsule ReadAccountInfo(SingleAccountInfo info) { BankCommsCapsule commsCapsule = new BankCommsCapsule(info.login, info.password); //TODO bank url creation return(commsCapsule); }
internal BankCommsCapsule CreateBankCommunicationsCapsule(SingleAccountInfo info) { ConfigReader configReader = new ConfigReader(); BankCommsCapsule capsule = configReader.ReadAccountInfo(info); return(capsule); }
internal BankCommsCapsule CreateBankCommunicationsCapsule(SingleAccountInfo info) { ConfigReader configReader = new ConfigReader(); BankCommsCapsule capsule = configReader.ReadAccountInfo(info); return capsule; }
internal void DisplayBankAccounts(SingleAccountInfo bankInfo) { try { Console.WriteLine("Your bank: {0}", bankInfo.bankName); Console.WriteLine("Your account: {0}\n", bankInfo.accountType); } catch (Exception e) { throw e; } }
public BankAccountDetails GiveAccountDetails(SingleAccountInfo info) { AccountInfoRequestFactory factory = new AccountInfoRequestFactory(); BankCommsCapsule capsule = factory.CreateBankCommunicationsCapsule(info); CommunicationsResponse resp = _selectedComms.RetrieveSelectedBankAccountDetails(capsule);//the part where magic happens AccountInfoResponseParser parser = new AccountInfoResponseParser(); BankAccountDetails details = parser.FormAccountDetails(resp); return details; }
public BankAccountDetails GiveAccountDetails(SingleAccountInfo info) { AccountInfoRequestFactory factory = new AccountInfoRequestFactory(); BankCommsCapsule capsule = factory.CreateBankCommunicationsCapsule(info); CommunicationsResponse resp = _selectedComms.RetrieveSelectedBankAccountDetails(capsule);//the part where magic happens AccountInfoResponseParser parser = new AccountInfoResponseParser(); BankAccountDetails details = parser.FormAccountDetails(resp); return(details); }
public SingleAccountInfo ChooseAccount(string selectedAccount, SingleAccountInfo[] allBanksInfo) { SingleAccountInfo selectedAccountInfo = new SingleAccountInfo(); foreach (var bankInfo in allBanksInfo) { if (bankInfo.bankName == selectedAccount) selectedAccountInfo = bankInfo; } Console.WriteLine("Chosen account: {0}", selectedAccountInfo.bankName); return selectedAccountInfo; }
public void GiveAccountDetailsDoesAnythingAtAll() { //Given SingleAccountInfo fakeAccountInfo = new SingleAccountInfo(); IRequestComms selectedComms = new MockRequestComms(fakeAccountInfo); CommunicationModule moduleUnderTest = new CommunicationModule(selectedComms); //When BankAccountDetails result = moduleUnderTest.GiveAccountDetails(fakeAccountInfo); //Then Assert.IsTrue(result != null); }
public SingleAccountInfo ChooseAccount(string selectedAccount, SingleAccountInfo[] allBanksInfo) { SingleAccountInfo selectedAccountInfo = new SingleAccountInfo(); foreach (var bankInfo in allBanksInfo) { if (bankInfo.bankName == selectedAccount) { selectedAccountInfo = bankInfo; } } Console.WriteLine("Chosen account: {0}", selectedAccountInfo.bankName); return(selectedAccountInfo); }
public void Initialise() { AccountManager accountManager = new AccountManager(); allBanksInfo = accountManager.AllBankAccounts(); foreach (var bankInfo in allBanksInfo) { uiDisp.DisplayBankAccounts(bankInfo); } string selectedAccount = uiDisp.ChooseAccount(); SingleAccountInfo chosenAccount = accountManager.ChooseAccount(selectedAccount, allBanksInfo); accountManager.GiveAccountDetails(chosenAccount); }
internal BankCommsCapsule ReadAccountInfo(SingleAccountInfo info) { BankCommsCapsule commsCapsule = new BankCommsCapsule(info.login, info.password); //TODO bank url creation return commsCapsule; }
public MockRequestComms(SingleAccountInfo fakeInfo) { _fakeInfo = fakeInfo; }