diff --git a/FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/content.txt b/FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/content.txt new file mode 100644 index 0000000000..9fe94850c5 --- /dev/null +++ b/FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/content.txt @@ -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]]]| diff --git a/FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/properties.xml b/FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/properties.xml new file mode 100644 index 0000000000..1e3157cd24 --- /dev/null +++ b/FitNesseRoot/FitNesse/SuiteAcceptanceTests/SuiteSlimTests/LibrarySuite/HowToAddFixturesWithParamertersToTheLibrary/properties.xml @@ -0,0 +1,13 @@ + + +true +true +six42 +true +true +true +true +true +true +true + diff --git a/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/content.txt b/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/content.txt index 6c0397fa65..3d7bff1260 100644 --- a/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/content.txt +++ b/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/content.txt @@ -43,4 +43,5 @@ The order of method execution is as follows: 2. Find method on SystemUnderTest, if present execute 3. Find method on installed Library in '''reversed''' order of creation. So last one created takes precedence over the ones created earlier. - +If you need to initialise the fixture you want to add to the library or your fixture has constructor parameters than this is possible as well. +See details on [[How To Add Fixtures With Paramerters To The Library][.FitNesse.SuiteAcceptanceTests.SuiteSlimTests.LibrarySuite.HowToAddFixturesWithParamertersToTheLibrary]] diff --git a/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/properties.xml b/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/properties.xml index 72aa2b6a6b..9bb72bef1e 100644 --- a/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/properties.xml +++ b/FitNesseRoot/FitNesse/UserGuide/WritingAcceptanceTests/SliM/LibraryTable/properties.xml @@ -1,11 +1,13 @@ - + - true - true - true - true - true - true - true - true + + +six42 + + + + + + +