Exemple #1
0
        internal BankAccountDetails GiveAccountDetails(SingleAccountInfo selectedAccountInfo)
        {
            WebRequestComms sComms = new WebRequestComms();
            CommunicationModule comms = new CommunicationModule(sComms);

            return comms.GiveAccountDetails(selectedAccountInfo);
        }
Exemple #2
0
        internal BankAccountDetails GiveAccountDetails(SingleAccountInfo selectedAccountInfo)
        {
            WebRequestComms     sComms = new WebRequestComms();
            CommunicationModule comms  = new CommunicationModule(sComms);

            return(comms.GiveAccountDetails(selectedAccountInfo));
        }
Exemple #3
0
        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;
        }
Exemple #6
0
 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;
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        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);
        }
Exemple #13
0
        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);
        }
Exemple #14
0
 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;
 }
Exemple #16
0
 public MockRequestComms(SingleAccountInfo fakeInfo)
 {
     _fakeInfo = fakeInfo;
 }