I got fitnesse.jar from http://fitnesse.org and put it in C:\apps\fitnesse. I got the latest fitSharp release from http://github.com/jediwhale/fitsharp and unzipped it into c:\apps\fitnesse\dotnet.
I created a Visual Studio solution in c:\projects\fitsharpsample. I added a class library project called Fixtures. I added references to fit.dll and fitsharp.dll from c:\apps\fitnesse\dotnet. I added a class called SampleDo:
using fitlibrary;In my solution folder, I created a fitnesseRoot folder. I created a file fitnesse.cmd to run FitNesse:
namespace Fixtures {
public class SampleDo: DoFixture {
public string Greeting { get { return "hi"; } }
}
}
java -jar \apps\fitnesse\fitnesse.jar -p 8080 -d "c:\projects\fitsharpsample" -r fitNesseRootI created a configuration file storytest.config.xml:
pause
<suiteConfig>In my browser, I went to http://localhost:8080 and clicked the root link and edited the root page to contain:
<Settings>
<Runner>fitnesse.fitserver.FitServer</Runner>
</Settings>
<ApplicationUnderTest>
<addNamespace>Fixtures</addNamespace>
<addAssembly>c:\projects\fitsharpsample\build\debug\Fixtures.dll</addAssembly>
</ApplicationUnderTest>
</suiteConfig>
!define TEST_RUNNER {c:\apps\fitnesse\dotnet\Runner.exe}I added a SampleTest page in FitNesse:
!define COMMAND_PATTERN {%m -c c:\projects\fitsharpsample\storytest.config.xml %p}
|sample do|I ran the test and all green!
|check|greeting|hi|
Assertions: 1 right, 0 wrong, 0 ignored, 0 exceptions (0.000 seconds)
| sample do | ||
| check | greeting | hi |
0 comments:
Post a Comment