首页 > 代码库 > C# Nunit Unit Testing
C# Nunit Unit Testing
http://www.youtube.com/watch?v=1TPZetHaZ-A Introduction To NUnit
1. create Nunit test case
(1)new Project -> Class Library C#
(2) add new item -> Class C#
(3) add service :nunit.framework.dll
(4) add
using NUnit.Framework;
(5) code
namespace MyUnitTest{ [TestFixture] class Test7CalDay { [Test] public void test1() { CalculateDayService.CalculateDayServiceClient client = new CalculateDayService.CalculateDayServiceClient(); string day1 = "20140801"; string day2 = "20140802"; int diff = client.CalculateDay(day1, day2); Assert.AreEqual(1, diff); } }}
2. testing tool
(1) resharper
C# Nunit Unit Testing
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。