Nunit学习笔记

Nunit相关文件下载:http://nunit.org/?p=download

主要用于对项目进行单个功能的测试

测试实例:

using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using GameBLL;
using System.Data;

namespace IleNuint
{
    [TestFixture]
    public class IleTest
    {
        [Test]
        public void test()
        {
            DataSet ds = Util.Getlist();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Console.WriteLine(Util.GetTitle(dr[0].ToString(), dr[1].ToString(), "faafaf", "fafafa", "dafafaf"));
            }
            Assert.IsTrue(false); //断言,类似于在VS上打上断点,将会成Nuint软件测试时停止运行。。有很多重载方法,
        }
    }
}

详细文档见:http://www.36sign.com/nunit/platform.html

原文地址:https://www.cnblogs.com/qingyi/p/1753079.html