public void BasicAccountsIterator_Get_ReturnsSingleItemForSingleAccount()
        {
            Account account = new Account(null, "test-account");
            BasicAccountsIterator iterator = new BasicAccountsIterator(account);
            List <Account>        result   = iterator.Get().ToList();

            Assert.Single(result);
            Assert.Equal(account, result[0]);
        }
        public void BasicAccountsIterator_Get_ReturnsAllAccountsInTree()
        {
            Account account1  = new Account();
            Account account11 = new Account(account1, "test-account-11");
            Account account12 = new Account(account1, "test-account-12");

            account1.AddAccount(account11);
            account1.AddAccount(account12);

            BasicAccountsIterator iterator = new BasicAccountsIterator(account1);
            List <Account>        result   = iterator.Get().ToList();

            Assert.Equal(3, result.Count);
            Assert.Equal(account1, result[0]);
            Assert.Equal(account11, result[1]);
            Assert.Equal(account12, result[2]);
        }
        public void BasicAccountsIterator_Get_FailsForNullAccount()
        {
            BasicAccountsIterator iterator = new BasicAccountsIterator(null);

            Assert.Throws <ArgumentNullException>(() => iterator.Get().ToList());
        }
Ejemplo n.º 4
0
 public void BasicAccountsIterator_Get_FailsForNullAccount()
 {
     BasicAccountsIterator iterator = new BasicAccountsIterator(null);
     List <Account>        result   = iterator.Get().ToList();
 }