没有用过,是作单无测试的吗?
我只用过DUNIT(Delphi的啦:))
不过感觉原理应该是一样的:你自己写一些程序来调用你的功能模块,然后看你的模块是否正确
TestDriven.NET 不过是NUnit等单元测试工具的VS.Net的插件而已。
安装之后,在VS的“解决方案管理器”中选择project,右键会弹出它的相关菜单, Run tests 和 test with...。
使用比较简单, 首先建立Project,写测试类,如:
using System;
using NUnit.Framework;
namespace TestProject.Logic
{
[TestFixture]
public class TestExample
{
[Test]
public void Example()
{
Assert.AreEqual(2,System.Math.Min(2,3),"System.Math.Min方法出错");
}
}
}
运行Run tests 菜单就可以了,该工具会将测试结果显示在VS.net的输出窗口中。
另外,在Run with...中,有以下两项:
Debuger ------在测试时,允许调试。
NUint GUI ------调用NUnit的GUI界面进行测试。
有人用Application Center Test做测试么?希望能介绍一下心得。