zoukankan      html  css  js  c++  java
  • 在Visual Studio中使用NUnit

    NUnit是一个非常好用的单元测试工具,在Visual Studio使用NUnit能够非常方便的进行单元测试。

    1.下载Nunit

    NUnit官方网站下载最新版Nunit,并安装

    2.下载在Visual Studio中使用NUnit的插件。

    我使用的Testdriven.net插件,比较好用。

    可以在其官方网站下载个人免费版使用。

    这样就完成了整个安装过程,比较简单吧,呵呵。下面一个简单的示例。

    新建C#项目,在reference中添加

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using NUnit.Framework; 
    
    namespace Test
    {
        [TestFixture]
        class Worker
        {
            bool GetPrice()
            {
                return true;
            } 
    
            [Test]
            public void TestGetPrice()
            {
                Assert.IsTrue(GetPrice());
            }
        }
    }
  • 相关阅读:
    Mybatis完成CRUD(四)
    Log4j日志配置
    Mybatis学习笔记(二)配置文件
    Mybatis学习笔记(一)入门例子
    jquery自动将form表单封装成json
    SpringMVC学习笔记(六)
    springMVC学习笔记(五)
    Oracle 数据库语句大全
    J a v a 的“多重继承”
    接口--interface
  • 原文地址:https://www.cnblogs.com/glorey/p/1834095.html
Copyright © 2011-2022 走看看