forked from unclebob/fitnesse
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fixtures with parameters to the library
Update of the documentation to show a nice feature of FitNesse: Add fixtures with parameters to the library
- Loading branch information
Showing
4 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...Tests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/content.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
!|import | | ||
|fitnesse.slim.test| | ||
|
||
Create a fixture with constructor parameters. | ||
You can do further set up by calling more methods of the fixture if required. | ||
At the end assign the fixture itself to a symbol. | ||
|
||
!|script|test query|2| | ||
|show |query | | ||
|$tq= |get fixture | | ||
|
||
Negative Test: This must raise an exception as the method query can not be found | ||
!|script|echo fixture | | ||
|check |echo |AAA |AAA | | ||
|#check |query|[[[n, 1], [2n, 2]], [[n, 2], [2n, 4]]]| | ||
|
||
Now add the previously created fixture symbol to the library | ||
|library| | ||
|$tq | | ||
|
||
And here we go: We can use the methods of the fixture in any script | ||
!|script|echo fixture | | ||
|check |echo |AAA |AAA | | ||
|check |query|[[[n, 1], [2n, 2]], [[n, 2], [2n, 4]]]| |
13 changes: 13 additions & 0 deletions
13
...ts/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/properties.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<properties> | ||
<Edit>true</Edit> | ||
<Files>true</Files> | ||
<LastModifyingUser>six42</LastModifyingUser> | ||
<Properties>true</Properties> | ||
<RecentChanges>true</RecentChanges> | ||
<Refactor>true</Refactor> | ||
<Search>true</Search> | ||
<Test>true</Test> | ||
<Versions>true</Versions> | ||
<WhereUsed>true</WhereUsed> | ||
</properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/properties.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<properties> | ||
<Edit>true</Edit> | ||
<Files>true</Files> | ||
<Properties>true</Properties> | ||
<RecentChanges>true</RecentChanges> | ||
<Refactor>true</Refactor> | ||
<Search>true</Search> | ||
<Versions>true</Versions> | ||
<WhereUsed>true</WhereUsed> | ||
<Edit/> | ||
<Files/> | ||
<LastModifyingUser>six42</LastModifyingUser> | ||
<Properties/> | ||
<RecentChanges/> | ||
<Refactor/> | ||
<Search/> | ||
<Static/> | ||
<Versions/> | ||
<WhereUsed/> | ||
</properties> |