使用Visual Studio的单元测试工具进行测试
2012-05-17 07:21:54 来源:WEB开发网核心提示:using Microsoft.VisualStudio.QualityTools.UnitTesting.Framework;using System;namespace VSTSDemo.Test{ /// <summary> ///This is a test class for VSTTDe
using Microsoft.VisualStudio.QualityTools.UnitTesting.Framework; using System; namespace VSTSDemo.Test { /// <summary> ///This is a test class for VSTTDemo.LogonInfo and is intended ///to contain all VSTTDemo.LogonInfo Unit Tests ///</summary> [TestClass()] public class LogonInfoTest { private TestContext testContextInstance; /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the ///current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } /// <summary> ///Initialize() is called once during test execution before ///test methods in this test class are executed. ///</summary> [TestInitialize()] public void Initialize() { // TODO: Add test initialization code } /// <summary> ///Cleanup() is called once during test execution after ///test methods in this class have executed unless ///this test class' Initialize() method throws an exception. ///</summary> [TestCleanup()] public void Cleanup() { // TODO: Add test cleanup code } // ... [TestMethod] // ... public void ChangePasswordTest() { // ... } } }
更多精彩
赞助商链接