使用VisualStudio2005TeamSystem進行單元測試[11] 軟件測試
AssemblyInitialize()
在執行為執行選擇的第一個 TestClass() 中的第一個 TestMethod() 之前,執行帶有該屬性的方法。
ClassInitialize()
帶有該屬性的方法在執行第一個測試之前調用。
TestInitialize()
帶有該屬性的方法在執行每個 TestMethod() 之前調用。
TestCleanup()
帶有該屬性的方法在執行每個 TestMethod() 之后調用。
ClassCleanup()
帶有該屬性的方法在執行 ALL 測試之后調用。
AssemblyCleanup()
在執行為執行選擇的第一個 TestClass() 中的第一個 TestMethod() 之后,執行帶有該屬性的方法。
Description()
提供關于給定 TestMethod() 的描述。
Ignore()
由于某種原因忽略 TestMethod() 或 TestClass()。
ExpectedException()
當測試特定異常時,如果使用該屬性指定的異常不是從實現代碼引發,則測試不會失敗。
原文轉自:http://www.anti-gravitydesign.com