Expanded Unit Tests
This commit is contained in:
@@ -1,15 +1,43 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using Week_10___Account_Library;
|
||||
|
||||
namespace Week_10___TDD_Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class TDDTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
private Account account;
|
||||
[TestInitialize]
|
||||
public void InitTests()
|
||||
{
|
||||
account = new Account(1000, 500);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DepositAmount()
|
||||
{
|
||||
account.Deposit(200);
|
||||
Assert.AreEqual(1200, account.Balance);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void WithdrawAmount()
|
||||
{
|
||||
account.Withdraw(200);
|
||||
Assert.AreEqual(800, account.Balance);
|
||||
}
|
||||
|
||||
[TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
|
||||
public void WithdrawNegative()
|
||||
{
|
||||
account.Withdraw(-200);
|
||||
}
|
||||
|
||||
[TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
|
||||
public void DepositNegative()
|
||||
{
|
||||
account.Deposit(-200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user