Esempio n. 1
0
        public void GetAccountById_InvalidTest()
        {
            FinanceManager financeManager = new FinanceManager();

            FinantialDB.Accounts.Clear();
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            Guid targetId = FinantialDB.Accounts.Values.ToList()[0].ID;

            Assert.Throws <KeyNotFoundException>(() => financeManager.GetAccountByID(Guid.NewGuid()));
        }
Esempio n. 2
0
        public void GetAccountById_ValidTest()
        {
            FinanceManager financeManager = new FinanceManager();

            FinantialDB.Accounts.Clear();
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            Guid targetId = FinantialDB.Accounts.Values.ToList()[0].ID;

            IAccount account = financeManager.GetAccountByID(targetId);

            Assert.IsTrue(account.ID == targetId);
        }