简体   繁体   English

如何设置FitNesse以与.NET一起使用?

[英]How do I setup FitNesse for use with .NET?

I'm trying to get started with FitNesse for .NET on Windows Vista. 我正试图在Windows Vista上开始使用FitNesse for .NET。 In all tutorials I find on the web I'm told to execute the run.bat file, but all i get when downloading the latest release is a .jar-file. 在我在网上找到的所有教程中,我都被告知要执行run.bat文件,但是在下载最新版本时我得到的只是一个.jar文件。 When i run this, the filestructure is unpacked and I can reach the fitnesse server by browsing to http://localhost . 当我运行它时,文件结构被解压缩,我可以通过浏览http:// localhost到达fitnesse服务器。 Now, when I'm trying to set up a test project, according to all documentation I find I'm supposed define the path to fitsharp.dll but I can't find this file anywhere in the filestructure that was set up from the .jar-file. 现在,当我尝试设置一个测试项目时,根据所有文档,我发现我应该定义fitsharp.dll的路径,但是我无法在文件结构中的任何位置找到此文件。 JAR文件。 What am I doing wrong? 我究竟做错了什么?

Download FitNesse jar from http://fitnesse.org/ . http://fitnesse.org/下载FitNesse jar。

Run

java -jar fitnesse.jar

It will start web server and create folder FitNesseRoot with wiki contents. 它将启动Web服务器并使用wiki内容创建文件夹FitNesseRoot To check that it has started navigate to http://localhost - you should see FitNesse front page. 要检查它是否已开始导航到http://localhost - 您应该看到FitNesse首页。

Edit front page - just add something like HelloWorldTest (must be camel case!) in the bottom and save. 编辑首页 - 只需在底部添加HelloWorldTest (必须是camel case!)等内容并保存。 Click on the appeared question mark and save a new page. 单击出现的问号并保存新页面。 Click Properties and make sure Page type is Test . 单击“ 属性” ,确保“ 页面类型”为“ 测试”

Download FitSharp from https://github.com/jediwhale/fitsharp and extract it to folder fitsharp next to your FitNesseRoot . https://github.com/jediwhale/fitsharp下载FitSharp并将其解压缩FitNesseRoot旁边的文件夹fitsharp

Create .Net project for tests, add references to fit.dll and fitSharp.dll located in just created fitsharp folder. 为测试创建.Net项目,添加对刚刚创建的fitsharp文件夹中的fit.dllfitSharp.dll的引用。

Write a simple test in .Net and compile it. 在.Net中编写一个简单的测试并编译它。 For example use a simple column fixture as described on http://fitnesse.org/FitNesse.UserGuide.FixtureGallery.BasicFitFixtures.ColumnFixture . 例如,使用http://fitnesse.org/FitNesse.UserGuide.FixtureGallery.BasicFitFixtures.ColumnFixture中描述的简单列夹具。 Add test table to our HelloWorldTest page. 将测试表添加到HelloWorldTest页面。

On top of your FitNesse test page (in our example HelloWorldTest ) enter: 在FitNesse测试页面上(在我们的示例HelloWorldTest中 )输入:

!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,fitsharp\fit.dll %p}
!define TEST_RUNNER {fitsharp\Runner.exe}
!path <path to your test assembly>

If you click on Test button and see no results then try to use TEST_RUNNER RunnerW.exe for troubleshooting. 如果单击“ Test按钮并且看不到任何结果,请尝试使用TEST_RUNNER RunnerW.exe进行故障排除。

Here's a great book on using FitNesse with .Net: http://fitnesse.s3.amazonaws.com/tdd_net_with_fitnesse.pdf 这是一本关于将FitNesse与.Net一起使用的好书: http//fitnesse.s3.amazonaws.com/tdd_net_with_fitnesse.pdf

Checkout this free ebook: Test Driven .NET Development With FitNesse: Second Edition 查看这个免费的电子书: 使用FitNesse进行测试驱动的.NET开发:第二版

It will show you everything you need, from how to set up FitNesse with FitSharp, to best practices. 它将向您展示您需要的一切,从如何使用FitSharp设置FitNesse,到最佳实践。

You'll need to get the FitSharp dll from http://github.com/jediwhale/fitsharp/downloads . 您需要从http://github.com/jediwhale/fitsharp/downloads获取FitSharp dll。

The .NET code is no longer bundled with FitNesse and is available here: http://github.com/jediwhale/fitsharp/downloads .NET代码不再与FitNesse捆绑在一起,可在此处获取: http//github.com/jediwhale/fitsharp/downloads

Here's some information to get you started: http://fitsharp.github.com 以下是一些可以帮助您入门的信息: http//fitsharp.github.com

Goto your http://localhost/root (special page for FitNesse) and paste this in there: 转到你的http://localhost/root (FitNesse的特殊页面)并将其粘贴到那里:

variable defined: COMMAND_PATTERN=%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p
variable defined: TEST_RUNNER=dotnet2\Runner.exe
variable defined: PATH_SEPARATOR=;
classpath: dotnet2\*.dll

Unzip the FitSharp binaries into a folder called dotnet2 under the folder you unpacked FitNesse. 将FitSharp二进制文件解压缩到解压缩FitNesse文件夹下名为dotnet2的文件夹中。

FitSharp also includes DbFit for MSSQL & Oracle testing. FitSharp还包括用于MSSQL和Oracle测试的DbFit。

If you haven't unpacked the .jar file, you need to run: java -jar fitnesse.jar. 如果尚未解压缩.jar文件,则需要运行:java -jar fitnesse.jar。 If you got that far, then follow jediwhale's very good tutorial. 如果你走得那么远,那就按照jediwhale的非常好的教程。 Here's a second, similar, tutorial, too: http://schuchert.wikispaces.com/FitNesse.Tutorials.CSharp.Slim.EachTable 这是第二个类似的教程: http//schuchert.wikispaces.com/FitNesse.Tutorials.CSharp.Slim.EachTable

I wrote step-by-step guide here: https://github.com/imanushin/NetRunner/wiki/Net-Runner-tutorial 我在这里写了一步一步的指南: https//github.com/imanushin/NetRunner/wiki/Net-Runner-tutorial

Short idea: 1. Install FitNesse (just copy it to the any directory) 2. Start FitNesse 3. Use NuGet (!) to retrieve one of the packages (NetRunner or FitSharp, any of them) 4. Write functions needed in the Visual Studio 5. Write functions calls in the FitNesse opened 简短的想法:1。安装FitNesse(只需将其复制到任何目录)2。启动FitNesse 3.使用NuGet(!)检索其中一个包(NetRunner或FitSharp,其中任何一个)4。编写Visual中所需的函数Studio 5.在FitNesse中打开函数调用

Fill free to ask more questions on the wiki page above. 在上面的维基页面上免费提出更多问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM