Visual Studio 2008单元测试实践[3]

发表于:2010-04-27来源:作者:点击数: 标签:实践单元StudioVisualvisual
Visual Studio 2008 单元测试 实践[3] 软件测试 生成的测试代码如下,为了紧凑的表现代码,将注释代码作了删除。 using BankAccountDemo.Business; using Microsoft.VisualStudio.TestTools. UnitTest ing; namespace BankAccountDemo.Business.Tests { [Tes

         Visual Studio 2008单元测试实践[3]   软件测试

  生成的测试代码如下,为了紧凑的表现代码,将注释代码作了删除。

  using BankAclearcase/" target="_blank" >ccountDemo.Business;

  using Microsoft.VisualStudio.TestTools.UnitTesting;

  namespace BankAccountDemo.Business.Tests

  {

  [TestClass()]

  public class BankAccountTest

  {

  private TestContext testContextInstance;

  public TestContext TestContext

  {

  get

  {

  return testContextInstance;

  }

  set

  {

  testContextInstance = value;

  }

  }

  #region Additional test attributes

  #endregion

  [TestMethod()]

  public void CurrentBalanceTest()

  {

  float initialBalance = 0F; // TODO: Initialize to an appropriate value

  BankAccount target = new BankAccount(initialBalance); // TODO: Initialize to an appropriate value

  float expected = 0F; // TODO: Initialize to an appropriate value

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