使用VisualStudio2005TeamSystem进行单元测试[6]

发表于:2010-05-12来源:作者:点击数: 标签:单元
使用VisualStudio2005TeamSystem进行 单元测试 [6] 软件测试 public void Initialize() { } [TestCleanup()] public void Cleanup() { } [TestMethod()] public void ConstructorTest() { float currentBalance = 500; BankAccount target = new BankAccount

  使用VisualStudio2005TeamSystem进行单元测试[6]   软件测试

  public void Initialize() {

  }

  [TestCleanup()]

  public void Cleanup() {

  }

  [TestMethod()]

  public void ConstructorTest() {

  float currentBalance = 500;

  BankAclearcase/" target="_blank" >ccount target = new BankAccount(currentBalance);

  Assert.AreEqual(currentBalance, target.CurrentBalance,

  "Balances are not equal upon creation");

  }

  [TestMethod()]

  public void DepositMoneyTest() {

  float currentBalance = 500;

  BankAccount target = new BankAccount(currentBalance);

  float depositAmount = 10;

  target.DepositMoney(depositAmount);

原文转自:http://www.ltesting.net