dedecms网站地图修改,品牌网站建设新闻,做网站设计都需要什么,wordpress 公网1、下载Nunit#xff1a;http://www.nunit.org/index.php?pdownload#xff0c;下载MSI格式的安装包#xff1b; 2、安装Nunit#xff0c;根据提示安装即可#xff0c;没有什么需要配置的#xff0c;直接下一步就可以了。 3、新建类库项目NUnitQuickStart#xff0c;在…1、下载Nunithttp://www.nunit.org/index.php?pdownload下载MSI格式的安装包 2、安装Nunit根据提示安装即可没有什么需要配置的直接下一步就可以了。 3、新建类库项目NUnitQuickStart在该项目添加引用nunit.framework。 4、新建类NumbersFixture添加如下代码 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;namespace NUnitQuickStart
{[TestFixture]public class NumbersFixture{[Test]public void Sum(){int a1;int b2;int sum a b;Assert.AreEqual(3,sum);}}
}5、右击该类库项目选择属性打开之后单击调试选择启动外部程序单击带……的按钮在打开新的对话框之后选择安装Nunit目录下的C:\Program Files\NUnit 2.5.10\bin\net-2.0\nunit.exe这是我的安装目录。选择好之后单击vs中的调试按钮即可调试。vs会自动打开Nunit这时Nunit什么也没显示选择FileOpen File打开你的项目然后单击Run按钮即可进行测试。转载于:https://www.cnblogs.com/GaoHuhu/archive/2012/04/16/2451566.html