.net 自动化测试介绍( NUnit NUnitAsp NDoc)

Dot Net 自动化 单元测试及文档抽取

 

— 背景

    单元测试 , 针对 C# 目前有多解决方案 , 但是针对 ASPX 特别是页面逻辑 , 页面控制 , 以及页面控件等表现方面 , 目前开发人员尚未建立很好的开发经验 .

   测试后 , 测试文档工作 , 如果纯手工编辑 , 效率和质量不高 , 鉴于这种情况 , 通过调查 , DOT NET 方面整合一套解决方案 NUnit+NUnitAsp+NDoc 来提升项目组工作 .

 

优点 :

   VS 无缝集成 , 编写测试用例时遵从 VS 默认注释格式即可 ( 特殊需求除外 ), 自动化单元测试 , 可持续管理 , 用例可文档管理以及系统 API 自动抽取 , 质量和效率明显提升 .

缺点

   需要配置 , 不太方便

 

— 运行环境

IDE:  VS 2005

Framework Version : 2.0

 

— 概述

   VS IDE , 如何方便集成单元测试 , 自动化测试 , 推荐使用以下开源组合 :

   NUnit , NUnitAsp,Ndoc


   NUnit 实现 CS 文件单元测试 , 图形化管理 ;


    NUnitAsp 实现 ASPX 文件单元测试 , 集成于 Nunit , 以图形化方法管理 , 其本身有诸多美中不足 , 不过还是一款优秀的开源软件 ;


   Ndoc 是讲格式化文件自动抽取 , 文档输出开源软件 .

 

— NUnit

  http://sourceforge.net/projects/nunitasp/files/NUnitAsp/NUnitAsp-2.0/NUnitAsp-2.0.zip/download

— NUnitAsp

  http://sourceforge.net/projects/nunitasp/files/NUnitAsp/NUnitAsp-2.0/NUnitAsp-2.0.zip/download

— Ndoc

  http://sourceforge.net/projects/ndoc05/files/ndoc05/Beta%20Testing/NDoc2005BetaSrc.zip/download

 

 

介绍 NUnit

安装向导 :

http://www.nunit.org/index.php?p=installation&r=2.5.2

快速入门 :

http://www.nunit.org/index.php?p=quickStart&r=2.5.2

 

配置 :

测试工程引用文件 :

NUnit.Framework.DLL

 

介绍 NUnitASP

安装向导 :

http://nunitasp.sourceforge.net/installation.html

快速入门 :

http://nunitasp.sourceforge.net/quickstart.html

缺陷 :

    NUnitAsp still has some dramatic flaws: no support for Javascript , tests running in a different process than ASP.NET, difficulty setting up sessions . Most people ended up using it for acceptance testing, rather than unit testing, and Selenium, Watir , and the like are better for that. Most folks "in the know" are using presentation layers to make ASP.NET so thin that a tool like NUnitAsp isn't helpful.

摘自 , http://nunitasp.sourceforge.net/index.html

配置 :

测试工程引用文件 :

NUnitASP.DLL

NUnit.Framework.DLL

驱动测试类继承一个适配抽象类

WebTestAdapter.cs(这里是本人修改的,详细需要参考 NUnitASP资源中的说明)

介绍 NDoc

安装向导 :

http://sourceforge.net/projects/ndoc05/files/ndoc05/Beta%20Testing/NDoc2005BetaSrc.zip/download

快速入门 :

http://ndoc.sourceforge.net/usersguide.html

解决中文问题 :

http://www.cnblogs.com/BG5SBK/archive/2006/08/18/ndoc.html

配置 :

        在测试工程 VS 项目属性中需要指定输出格式 , NDOC Build 做准备

 

案例

— 一个网站
— 一个类库
— 一个测试工程

使用 NUnitASP 测试页面逻辑和表现

使用 NUnit 测试 C# 方法接口

使用 Ndoc 自动抽取测试用例及系统 API

 

很抱歉,不能附加截屏.

 

 

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值