public void test() { //Arrange //Act List <IAccount> accountA = bank.GetAccounts(customerJonas); //Assert Assert.AreEqual(8, accountA.Count); // The reason why its 8 and not just the two elements, is becouse we have 4 method calling it // filling the list up with 8 elements. }
public void Deposit_Precondition_Failed() { var owner = _bank.GetOwner("Emily", "Rodgers"); var checking = _bank.GetAccounts <Checking>(owner.Id).ElementAt(0); try { var deposit = _bank.Deposit(checking, -100); Assert.Null(deposit); } catch (Exception e) { Assert.IsType <ArgumentException>(e); Assert.Contains(e.Message, "Transactions require a positive amount"); } }