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
Mono 3.2 上跑NUnit测试的更多相关文章
- RazorEngine 3.3 在Mono 3.2上正常运行
RazorEngine 是一个简化的模板引擎基于微软新的Razor 解析引擎, Razor是在 ASP.NET MVC3 和 Web Pages中引入的.RazorEngine 提供了一个外包装和额外 ...
- 让python在hadoop上跑起来
duang~好久没有更新博客啦,原因很简单,实习啦-好吧,我过来这边上班表示觉得自己简直弱爆了.第一周,配置环境:第二周,将数据可视化,包括学习了excel2013的一些高大上的技能,例如数据透视表和 ...
- Nunit测试工具使用实例
前言: 本文主要是介绍了Nunit的基本使用,其中参详了很多已有的文章,由于最近要使用其进行测试,所以对网上的文章做了下整理,同时加入了一些自己的实践. NUnit的属性 TestFixture 它标 ...
- 在win7上跑基于任少卿作者代码修改的RPN+BF实验
1.前言 之前在win10上成功的跑起来faster-rcnn的实验,并且跑了一下CaltechPedestrian的数据集,但是效果一直不理想,折腾了好久也没弄清楚到底原因出在哪里,直到读了Is F ...
- 利用Tengine在树莓派上跑深度学习网络
树莓派是国内比较流行的一款卡片式计算机,但是受限于其硬件配置,用树莓派玩深度学习似乎有些艰难.最近OPENAI为嵌入式设备推出了一款AI框架Tengine,其对于配置的要求相比传统框架降低了很多,我尝 ...
- 让“是男人就下到100层”在Android平台上跑起来
原工程:https://github.com/jeekun/DownFloors 移植后的代码:HelloCpp.zip 移植后的APK:HelloCpp.apk 说明:(cocos2d-x版本是“ ...
- tomcat6~7~8用户设置及一个独立服务器上跑多个tomcat配置JVM设置优化亲测
tomcat6管理用户 在tomcat `安装根目录`/conf/tomcat-users.xml
- 使用XAMPP和DVWA在Windows7上搭建渗透测试环境
前言: XAMPP是一个Web应用程序运行环境集成软件包,包括MySQL.PHP.PerI和Apache的环境及Apache.MySQL.FilleZilla.Mercury和Tomecat等组件.D ...
- 使用WampServer和DVWA在Windows10上搭建渗透测试环境
前言: DVWA是一个具有脆弱性的Web测试应用,需要PHP和MySQL的环境支持.我们可以手动配置DVWA所需的运行环境,也可以使用WampServer进行搭建.WampServer是集成了Apac ...
随机推荐
- *** wechat-php-sdk 微信公众平台php开发包
wechat-php-sdk 微信公众平台php开发包,细化各项接口操作,支持链式调用,欢迎Fork此项目weixin developer SDK. 项目地址:https://github.com/d ...
- Sql server2012还原备份文件语句
--sql2012还原sql2008语句 --选择master数据库,新建查询 输入下面sql语句 --选择兼容模式(sql 2008)创建数据库db(还原时db写成原生数据库名称) RESTORE ...
- Oracle并发与多版本控制
1.什么是并发 2.事务隔离级别 2.1 READ UNCOMMITTED 2.2 READ COMMITTED 2.3 REPETABLE READ 2.4 SERIALIZ ...
- EF不能很好的支持DDD?估计是我们搞错了!
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:最近在ABP项目中尝试纯粹的DDD,然后遇到EF实现的Repository似乎不能很好 ...
- 配置mongoDB服务
上一节说到mongoDB的环境搭建,但是那种方法启动mongoDB太繁琐了. 今天先说说简化mongoDB启动的配置. 首先在命令行中运行的”C:\Program Files\MongoDB 2.6 ...
- HTTP请求应答服务——HTTP Request & Response Service
服务站点:https://httpbin.org/ Freely hosted in HTTP, HTTPS & EU flavors by Runscope DESCRIPTION Test ...
- allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[System.DateTime]
allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[S ...
- MyEclipse创建Maven工程
先要在MyEclipse中对Maven进行设置:
- wpf 加载项目图片的几种写法
new System.Windows.Media.Imaging.BitmapImage( new Uri("pack://application:,,,/TeacherAssistant. ...
- 运行时使用Dev的ImageListEditor
uses cxImageListEditor, cxGridMenuOperations; {$R *.dfm} procedure TForm1.Btn1Click(Sender: TObject) ...