1、使用TestDriven.Net1, 要用"TestDriven.Net2.0"进行单元测试除了安装"TestDriven.Net2.0"外,你需要添加"nunit.framework"引用, 操作是"解决方案管理器-->引用-->(鼠标右键)添加引用-->.net-->nunit.framework.2, 添加名字空间using NUnit.Framework; 为测试的类添加[TestFixture]特性 为测试方法添加[Test]特性3,示例代码using System;using System.Collections.Generic;using Sy
2、stem.Text;using NUnit.Framework;namespace TestDrivenTest{ [TestFixture] public class TestClass { [Test] public void TestRun() { Form1 frm1 = new Form1(); int expected = 0; int result = frm1.GetResult(2); Assert.Are