To test .NET applications with Slim, we need to add the .NET
Slim server provided by
fitSharp. Here's how we do that:
- Go to the github download page and click on the "release.x.x.zip" file. Save this file in a favorite download spot and then unzip it into a program folder, e.g., c:\apps\fitSharp.
- Add the following to the root page of the Slim tests. This could be the root of the FitNesse wiki (e.g., localhost:8080/root) if we're only doing Slim tests, or on the Slim test page or suite page if we have a mix of Slim and Fit tests in the wiki.
!define TEST_SYSTEM {slim}
!path c:\myfolder\mytest.dll
!define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner %p}
!define TEST_RUNNER {c:\apps\fitSharp\Runner.exe}
- Make sure the FitNesse root (e.g., localhost:8080/root) doesn't contain Java paths. If we find the following, we remove them.
!path classes
!path fitnesse.jar
!path fitlibrary.jar
- Write the Slim test tables and test fixtures as described on the FitNesse Slim pages. The Slim Import table is used to specify the namespaces to be searched for test classes. We can also use a Suite Configuration File:
<?xml version="1.0" encoding="utf-8" ?>
<suiteConfig>
<ApplicationUnderTest>
<addNamespace>My.Namespace</addNamespace>
</ApplicationUnderTest>
</suiteConfig>
- To run Slim tests from the command line, we can use the FitNesse Command Line REST Commands. This works with all types of Slim tests, including .NET.