I have a simple C# Column fixture class which independently tests fine. I have a sql server table which again, independently tests fine. If I test both, testing the SQL table first, again all is OK. However if I test the C# first, then the SQL test fails 'Type 'Connect' not found in assemblies'
So this works fine...
!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer %p}
!define TEST_RUNNER {fitsharp\Runner.exe}
!define PATH_SEPARATOR {;}
!path fitsharp/fit.dll
!path fitsharp/dbfit.sqlserver.dll
!|dbfit.SqlServerTest|
!|Connect|Data Source=localhost;integrated security=SSPI;Initial Catalog=Test2|
!|Query| select Colour from dbo.Colour|
|Colour|
|yellow-orange|
!path Fixtures.dll
!|Fixtures.SampleDo|
|firstPart|secondPart|together?|totalLength?|
|Hello|World|Hello, World|10|
|Houston|We Have a Problem|Houston, We Have a Problem|24|
... but this fails by simply moving the Fixtures.dll test ...
!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer %p}
!define TEST_RUNNER {fitsharp\Runner.exe}
!define PATH_SEPARATOR {;}
!path Fixtures.dll
!|Fixtures.SampleDo|
|firstPart|secondPart|together?|totalLength?|
|Hello|World|Hello, World|10|
|Houston|We Have a Problem|Houston, We Have a Problem|24|
!path fitsharp/fit.dll
!path fitsharp/dbfit.sqlserver.dll
!|dbfit.SqlServerTest|
!|Connect|Data Source=localhost;integrated security=SSPI;Initial Catalog=Test2|
!|Query| select Colour from dbo.Colour|
|Colour|
|yellow-orange|
Update: The original solution described below does not work for DbFit. Here is a workaround:
In your fixture
SampleDo
, you can include the following to letSqlServerTest
handle the rest of the tables in the test:Original answer:
When using DbFit, the table
is usually the first table in the test so it becomes the "System Under Test" and subsequent tables like
are interpreted as methods to be executed on
SqlServerTest
.If it is not the first table, something else will be the "System Under Test", in your case,
SampleDo
, and FitNesse will look for a methodConnect
onSampleDo
. To makeSqlServerTest
the "System Under Test" part way through the test, use the with keyword: