Example #1
0
        public static IAbstractFactory getAbstract(string choice)
        {
            if (IgnoreCase.equalIgnoreCase(choice, "Bank"))
            {
                return(new BankFactory());
            }
            else if (IgnoreCase.equalIgnoreCase(choice, "Loan"))
            {
                return(new LoanFactory());
            }

            throw new ArgumentOutOfRangeException(nameof(choice), choice, null);
        }
        public BankBase createBank(string bankName)
        {
            if (IgnoreCase.equalIgnoreCase(bankName, "ITAU"))
            {
                return(new BankItau());
            }
            else if (IgnoreCase.equalIgnoreCase(bankName, "BANCO DO BRASIL"))
            {
                return(new BankOfBrazil());
            }
            else if (IgnoreCase.equalIgnoreCase(bankName, "BRADESCO"))
            {
                return(new BankBradesco());
            }

            throw new ArgumentOutOfRangeException(nameof(bankName), bankName, null);
        }
Example #3
0
        public LoanBase createLoan(string loanName)
        {
            if (IgnoreCase.equalIgnoreCase(loanName, "HOME"))
            {
                return(new HomeLoan());
            }
            else if (IgnoreCase.equalIgnoreCase(loanName, "BUNISESS"))
            {
                return(new BunissessLoan());
            }
            else if (IgnoreCase.equalIgnoreCase(loanName, "EDUCATION"))
            {
                return(new EducationLoan());
            }

            throw new ArgumentOutOfRangeException(nameof(loanName), loanName, null);
        }