• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 使用VisualStudio2005TeamSystem進行單元測試[24]

    發表于:2010-05-13來源:作者:點擊數: 標簽:單元
    使用VisualStudio2005TeamSystem進行 單元測試 [24] 軟件測試 float depositAmt = 0; // TODO: Initialize to an appropriate value target.DepositMoney(depositAmt); Assert.Inconclusive("A method that does not return a value " + "cannot be verified

      使用VisualStudio2005TeamSystem進行單元測試[24]   軟件測試

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

      target.DepositMoney(depositAmt);

      Assert.Inconclusive("A method that does not return a value " +

      "cannot be verified.");

      }

      我們能夠完成相對容易且具有有限擊鍵的測試(更改部分用黑體表示)。

      [TestMethod()]

      public void DepositMoneyTest() {

      float currentBalance = 500;

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

      float depositAmt = 10;

      target.DepositMoney(depositAmt);

      Assert.AreEqual(currentBalance + depositAmt, target.CurrentBalance,

      "Deposit Test: Deposit not applied correctly");

      }

      重新生成單元測試代碼

      好消息是,代碼生成過程不會讓您重寫以前生成(和修改)的單元測試。使用 Visual Studio 2005 Team System 的 Beta 2 版本,代碼生成選項提供一個啟用/禁用創建已存在測試的復選框。如果選擇它,而且該過程找到了一個具有相同名稱的現有測試,則該過程將忽略該測試方法,并創建后續測試,從而將一個數字附加到該方法名的末尾。這通常在對象中使用重載的方法或構造函數時發生,或者當單擊 Generate 按鈕而不取消選定現有測試時發生。

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>