-
-
Save devjaime/e01d8cba1e26766dcc659cc76e50f29f to your computer and use it in GitHub Desktop.
pruebas unitarias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestClass()] | |
| public class AccountTests | |
| { | |
| [TestMethod()] | |
| public void CurrentBallanceTestPositiveCase() | |
| { | |
| IAccount account = new Account(); | |
| account.Deposit(100); | |
| double result = account.CurrentBallance; | |
| Assert.AreEqual(100, result); | |
| } | |
| [TestMethod()] | |
| public void DepositTestPositiveCase() | |
| { | |
| IAccount account = new Account(); | |
| double result = account.Deposit(100); | |
| Assert.AreEqual(100, result); | |
| } | |
| [TestMethod()] | |
| [ExpectedException(typeof(ArgumentException))] | |
| public void DepositTestNegativeAmount() | |
| { | |
| IAccount account = new Account(); | |
| double result = account.Deposit(-100); | |
| } | |
| [TestMethod()] | |
| public void WithdrawTestPositiveCase() | |
| { | |
| IAccount account = new Account(); | |
| account.Deposit(500); | |
| double result = account.Withdraw(400); | |
| Assert.AreEqual(100, result); | |
| } | |
| [TestMethod()] | |
| [ExpectedException(typeof(ArgumentException))] | |
| public void WithdrawTestNegativeWithdrawAmount() | |
| { | |
| IAccount account = new Account(); | |
| account.Deposit(200); | |
| double result = account.Withdraw(-300); | |
| } | |
| [TestMethod()] | |
| [ExpectedException(typeof(ArgumentException))] | |
| public void WithdrawTestWithMoreWithdrawAmountThanDeposit() | |
| { | |
| IAccount account = new Account(); | |
| account.Deposit(200); | |
| double result = account.Withdraw(300); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment