anybody knows some step by step tutorial for using slim fitnesse in .net ?
for now I managed to run the slim fitnesse website on my localhost:3434
and I unziped the fitSharp plugin in c:/fitSharp
but I have no idea what开发者_StackOverflow's next
FitNesse is a wiki with tables that can be executed to do system testing. Tables will then tell FitNesse to create some classes, do some operations on them, and check the result.
In order to work with .NET for example, you simply need to tell FitNesse how to link with .NET and which .NET assemblies to load. Nothing else. The .NET project can be a simple class library with no knowledge of FitNesse at all.
Requires tools
- FitNesse - The Java-based FitNesse wiki and testing framework.
- fitSharp - Contains .NET libraries to write FIT and SliM fixtures.
Sample steps
Download FitNesse and fitSharp (in this example fitSharp has been extracted to
D:\fit\fitSharp\release.1.9.net.35\
)Start FitNesse from the command-line:
java -jar fitnesse.jar -p 8080
Create and compile a C# Class Library project with:
namespace ClassLibrary1 { public class ShouldIBuyMilk { private int _cash; private int _pintsOfMilkRemaining; private string _useCreditCard; public void SetCashInWallet(int cash) { _cash = cash; } public void SetCreditCard(string useCreditCard) { _useCreditCard = useCreditCard; } public void SetPintsOfMilkRemaining(int pints) { _pintsOfMilkRemaining = pints; } public string GoToStore() { if (_cash > 0 || _useCreditCard.Equals("yes")) return "yes"; return "no"; } } }
Browse to http://localhost:8080/ then click '[add child]' next to the title and add a 'Test' page.
Type in the wiki page content like below (update the paths):
!define TEST_SYSTEM {slim} !define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner,D:\fit\fitSharp\release.1.9.net.35\fitsharp.dll %p} !define TEST_RUNNER {D:\fit\fitSharp\release.1.9.net.35\Runner.exe} !path D:\fit\MyFixture\ClassLibrary1\bin\Debug\ClassLibrary1.dll !|import| |ClassLibrary1| |Should I buy milk| |cash in wallet|credit card|pints of milk remaining|go to store?| | 0 | no | 0 | no | | 10 | no | 0 | yes | | 0 | yes | 0 | yes | | 10 | yes | 0 | yes | | 0 | no | 1 | no |
Note the '!' before
!|import|
is to avoid 'ClassLibrary1' to be seen as a wikiword.Save it, and click "Test" in the left menu. FitNesse will load the assembly, create an instance of your class, set some properties by following the naming convention mapping, and finally check some properties.
See also
- http://schuchert.wikispaces.com/Acceptance+Testing.UsingSlimDotNetInFitNesse
in your case this will be useful: http://fitsharp.github.com/Slim/GettingStarted.html
else you should consider: http://schuchert.wikispaces.com/Acceptance+Testing.UsingSlimDotNetInFitNesse
精彩评论