Mono 3.2 上跑NUnit测试
时间:2022-04-23
本文章向大家介绍Mono 3.2 上跑NUnit测试,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
NUnit是一款堪与JUnit齐名的开源的回归测试框架,供.net开发人员做单元测试之用,可以从www.nunit.org网站上免费获得,最新版本是2.5。Mono 3.2 源码安装的,在/usr/bin/ 下面有2.4.8 版本:
[azureuser@mono /]$ /usr/bin/nunit-console4
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Unix 2.6.32.279
CLR Version: 4.0.30319.17020 ( 3.3.0 (master/1022c50 Thu Jul 25 13:16:35 UTC 2013) )
fatal error: no inputs specified
本文用一个BDD的框架Bddify 进行测试,关于这个框架的更详细信息可以参看 BDDfy In Action。
[azureuser@mono /]$ sudo /usr/bin/nunit-console4 /home/azureuser/BddifySamples/Bddify.Samples.dll
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Unix 2.6.32.279
CLR Version: 4.0.30319.17020 ( 3.3.0 (master/1022c50 Thu Jul 25 13:16:35 UTC 2013) )
.Story: Account holder withdraws cash
As an Account Holder
I want to withdraw cash from an ATM
So that I can get money when the bank is closed
Scenario: Account has insufficient fund
Given the Account Balance is $10
And the Card is valid
And the machine contains enough money
When the Account Holder requests $20
Then the ATM should not dispense any Money
And the ATM should say there are Insufficient Funds
And the Account Balance should be $20
And the Card should be returned
.Story: Account holder withdraws cash
As an Account Holder
I want to withdraw cash from an ATM
So that I can get money when the bank is closed
Scenario: Account has sufficient fund
Given the account balance is $100
And the Card is valid
And the machine contains enough money
When the account holder requests $20
Then the ATM should dispense $20
And the account balance should be $80
And the card should be returned
.Story: Account holder withdraws cash
As an Account Holder
I want to withdraw cash from an ATM
So that I can get money when the bank is closed
Scenario: Card has been disabled
Given the Card is disabled
When the Account Holder requests 20
Then Card is retained
And the ATM should say the Card has been retained
.Story: Tic tac toe
As a player
I want to have a tic tac toe game
So that I can waste some time!
Scenario: Cat's game
Given the board rows looks like [X, O, X], [O, O, X] and [X, X, O]
Then it should be a cats game
.Story: Tic tac toe
As a player
I want to have a tic tac toe game
So that I can waste some time!
Scenario: O wins
Given the following board X, X, O, X, O, , , ,
When the game is played at (2, 0)
Then the winner should be O
.Story: Tic tac toe
As a player
I want to have a tic tac toe game
So that I can waste some time!
Scenario: When x and o play their first moves
Given a new game
When X and O play on (0, 0), (2, 2)
Then the board state should be X, , , , , , , , O
.N.Story: Tic tac toe
As a player
I want to have a tic tac toe game
So that I can waste some time!
Scenario: X wins
Given the board rows looks like [X, X, O], [X, X, O] and [O, O, ]
When x plays in the bottom right
Then the winner should be x
Tests run: 7, Failures: 0, Not run: 1, Time: 0.775 seconds
Introduction to bddify: A Simple to Use and Extend BDD Framework for .NET
- 微信小程序重磅功能上线!一键连Wi-Fi/手机变门禁卡
- MySQL下载安装、基本配置、问题处理
- windows下命令行模式中cd命令无效的原因
- 分布式和集群区别?什么是云计算平台?分布式的应用场景?
- 中国移动也要搞自动驾驶,没了SIM卡怎么耍花样?
- python并发编程之多进程理论部分
- 使用concurrent.futures模块并发,实现进程池、线程池
- 人工智能与医疗
- 每周论文清单:知识图谱,文本匹配,图像翻译,视频对象分割
- 进程池、线程池、回调函数
- java学习:weblogic下JNDI及JDBC连接测试(weblogic环境)
- 简单谈谈python的反射机制
- java学习:使用dom4j读写xml文件
- python文件和目录操作方法大全
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- spring 到底注入接口还是实现类?
- 韩松团队新作 | MCUNet | IoT设备+微型机器学习时代已经到来了
- SpringMVC在web.xml中的配置(引入springmvc)
- springmvc使用DELETE|PUT请求
- Mybatis缓存相关的知识
- 「2020最新」Spring最易学习教程—第一个Spring程序
- idea背景图片及简化插件
- 「2020最新」Spring最易学习教程—IOC 以及 整合Struts2
- SpringBoot整合Mybatis增删改查
- JavaWeb之Maven
- Mirages主题帮助文档
- Java作业-租车小系统
- 「2020最新」Spring最易学习教程 3— 代理设计模式 Spring AOP 动态代理原理
- 初入Mybatis:简介及配置
- Java多线程安全问题