public void WithdrawTooMuchMoney() { UniversityStudent student; student = new UniversityStudent( name, surname, patronymic, course, birthday, scholarship, balance ); FillAllMarks(ref student, 4); student.AddScholarship(); Assert.That( () => { student.Withdraw(scholarship + 1); }, Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void WithdrawAllMoney() { UniversityStudent student; student = new UniversityStudent( name, surname, patronymic, course, birthday, scholarship, balance ); FillAllMarks(ref student, 4); student.AddScholarship(); double prev_balance = student.balance; double got = student.Withdraw(scholarship); Assert.AreEqual(got, scholarship); Assert.AreEqual(student.balance, prev_balance - scholarship); }