Ejemplo n.º 1
0
        public string Start()
        {
            var payer = new Customer {
                FirstName       = "Achilles",
                LastName        = "Chatzianastassiou",
                SortCode        = 909090,
                AccountNumber   = 12345678,
                AmountInAccount = 1000,
                Address         = "Foo street"
            };
            var payee = new Customer
            {
                FirstName       = "Noob",
                LastName        = "Zor",
                SortCode        = 121212,
                AccountNumber   = 87654321,
                AmountInAccount = 5000,
                Address         = "Bar street"
            };

            double transactionAmount = 1000.00;

            //This is for part 3 of the question
            var transactionHistory = DatabaseOperations.GetBankAccountTransactionHistory(payer);

            //This is for part 1 of the question
            return(BankOperations.TransferMoneyFromOneBankAccountToAnother(payer, payee, transactionAmount));
        }
Ejemplo n.º 2
0
        public SbankenClient(string clientId, string clientSecret)
        {
            _connection = new Connection(clientId, clientSecret);

            Customers = new CustomerOperations(_connection);
            Bank      = new BankOperations(_connection);
        }
Ejemplo n.º 3
0
 public BankOperationsTests()
 {
     _connection     = A.Fake <IConnection>();
     _bankOperations = new BankOperations(_connection);
 }
Ejemplo n.º 4
0
        private static void Main(string[] args)
        {
            Console.Beep();
            Console.WriteLine("==========================================");
            Console.WriteLine("                 WELCOME");
            Console.WriteLine("==========================================");

            var running = true;

            try
            {
                while (running)
                {
                    Console.BackgroundColor = ConsoleColor.White;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.WriteLine("Type X and press Enter to terminate all operation \nType C and press Enter to register a customer \nType L and press Enter to LogIn a customer \nType LO and press Enter to LogOut a customer \nType A and press Enter to create a bank account for a customer \nType AC and press Enter to show details all accounts owned by a customer \nType D and press Enter to make deposit into an account \nType W and press Enter to make a withdrawal form an customer \nType T and press Enter to transfer funds to an account \nType S and press Enter to print the statement of an account \nType G and press Enter to print the statement of an account \n");
                    Console.BackgroundColor = ConsoleColor.Black;
                    Console.ForegroundColor = ConsoleColor.White;
                    var response = Console.ReadLine();
                    if (response != null)
                    {
                        switch (response)
                        {
                        case "x":
                            running = false;
                            break;

                        case "c":
                            BankOperations.CreateCustomer();
                            break;

                        case "l":
                            BankOperations.LogIn();
                            break;

                        case "lo":
                            BankOperations.LogOut();
                            break;

                        case "a":
                            BankOperations.CreateAccount();
                            break;

                        case "ac":
                            BankOperations.ShowAllMyAccountInfo();
                            break;

                        case "d":
                            BankOperations.Deposit();
                            break;

                        case "w":
                            BankOperations.WithDraw();
                            break;

                        case "t":
                            BankOperations.Transfer();
                            break;

                        case "s":
                            BankOperations.PrintStatement();
                            break;

                        case "g":
                            BankOperations.GetBalance();
                            break;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(e.Message);
                Console.ForegroundColor = ConsoleColor.White;
            }
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     Instance = this;
 }