phoenix13

导航

 

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

posted on 2014-11-21 02:33  phoenix13  阅读(286)  评论(0编辑  收藏  举报