使用TestDrive.docVIP

  • 14
  • 0
  • 约7.01千字
  • 约 12页
  • 2017-02-05 发布于湖北
  • 举报
使用TestDriven.Net1,??要用TestDriven.Net 2.0进行单元测试除了安装TestDriven.Net 2.0外,你需要添加nunit.framework引用,?操作是解决方案管理器--引用--(鼠标右键)添加引用--.net--nunit.framework. 2,?? 添加名字空间 using?NUnit.Framework; ??? 为测试的类添加[TestFixture]特性 ??? 为测试方法添加[Test]特性 3, 示例代码 using?System; using?System.Collections.Generic; using?System.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.AreEqua

文档评论(0)

1亿VIP精品文档

相关文档