FitNesse.NET
Specify Fixture
SpecifyFixture is used to specify the behavior of Fit. It is used here to specify its own behavior.

These tests use a CellMarking fixture that marks cells containing the text "right", "wrong", "ignore" or "exception".

The second row contains two cells. The first is used as input for test execution. the second is the expected result and is marked right or wrong, by matching it to the results from the test execution.

fat.SpecifyFixture

fat.SpecifyFixture

fat.CellMarking

fat.CellMarking

fat.SpecifyFixture

fat.CellMarking
[right]
fat.CellMarking

fat.SpecifyFixture

fat.SpecifyFixture

fat.CellMarking

fat.CellMarking
stuff
expected
in <table border="1" cellpadding="2" cellspacing="0">, expected: '<tr>', was null actual

fat.SpecifyFixture

fat.CellMarking
[wrong]
fat.CellMarking
stuff

An alternate format is the expected results cell placed in the first cell of the third row.

fat.SpecifyFixture

fat.SpecifyFixture

fat.CellMarking

fat.CellMarking

fat.SpecifyFixture

fat.CellMarking
[right]
fat.CellMarking

The expected result may contain keywords [right],[wrong], [ignore] or [exception] to indicate how test execution is expected to mark the cells. The actual value for a cell marked wrong is indicated with the format [wrong:actual-value].

fat.SpecifyFixture

fat.SpecifyFixture

fat.CellMarking
right
wrong
wrong expected
actual actual
actual
ignore
exception
System.ApplicationException: Error in the application.

fat.CellMarking
[right]right
[wrong]wrong
[wrong:actual]wrongactual
[ignore]ignore
[exception]exception

fat.SpecifyFixture

fat.CellMarking
[right]right
[wrong]wrong
[wrong:actual]wrongactual
[ignore]ignore
[exception]exception
[right]
fat.CellMarking
/[right]right
/[wrong]wrong
/[wrong:actual]wrongactual
/[ignore]ignore
/[exception]exception

Keyword text in the expected result can be escaped with a leading slash ("/") when it appears at the beginning of a cell in the test results. The escape character can escape itself as "//".

fat.SpecifyFixture

fat.SpecifyFixture

comment
[right]
[wrong]
/[right]

comment
/[right]
/[wrong]
//[right]
expected
in <table border="1" cellpadding="2" cellspacing="0">, in <tr>, expected: '<td>', was '<td class="ignore">' actual

fat.SpecifyFixture

comment
/[right]
/[wrong]
//[right]
[right]
comment
//[right]
//[wrong]
///[right]
expected
in <table border="1" cellpadding="2" cellspacing="0">, in <tr>, in <td>, in <table border="1" cellpadding="2" cellspacing="0">, in <tr>, expected: '<td>', was '<td class="ignore">' actual

Exception text is assumed to be implementation-dependent. The text can be defined with SpecifyTextFixture and referenced with the format [exception:text-id]. Each implementation should define its own text in a suite set up page.

fat.SpecifyFixture

fat.SpecifyTextFixture
my_text_idmy actual text

fat.SpecifyFixture

fat.CellMarking
exception
System.ApplicationException: my actual text
my actual text

fat.CellMarking
[exception:my_test_id]exceptionmy actual text

fat.SpecifyTextFixture
my_text_idmy actual text

fat.SpecifyFixture

fat.CellMarking
[exception]exceptionmy actual text
[right]
fat.CellMarking
/[exception:my_test_id]exceptionmy actual text

Some tests may apply only to certain implementations or versions. Each table can indicate this with a list of tags in the second cell of the first row. A suite set up page can use SpecifyVersionFixture to define the versions to be included.

fat.SpecifyFixture

fat.SpecifyVersionFixture
myVersionA
myVersionB

fat.SpecifyFixturemyVersionC,myVersionD

this test is ignored

this test is ignored

fat.SpecifyFixturemyVersionA,myVersionC

fat.CellMarking
right

fat.CellMarking
[right]right

fat.SpecifyVersionFixture
myVersionA
myVersionB

fat.SpecifyFixturemyVersionC,myVersionD

this test is ignored
[ignore]
this test is ignored

fat.SpecifyFixturemyVersionA,myVersionC

fat.CellMarking
[right]right
[right]
fat.CellMarking
/[right]right

Errors are reported if the table structure is invalid.

fat.SpecifyFixture

fat.SpecifyFixture
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: No second row. at fat.SpecifyFixture.GetInput(Parse table) at fat.SpecifyFixture.DoTable(Parse table) at fit.Fixture.ProcessTable(Parse table, Fixture activeFixture)

fat.SpecifyFixture
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: No embedded table for input. at fat.SpecifyFixture.GetInput(Parse table) at fat.SpecifyFixture.DoTable(Parse table) at fit.Fixture.ProcessTable(Parse table, Fixture activeFixture)
no table

fat.SpecifyFixture
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: No embedded table for expected results. at fat.SpecifyFixture.GetExpectedCell(Parse table) at fat.SpecifyFixture.DoTable(Parse table) at fit.Fixture.ProcessTable(Parse table, Fixture activeFixture)

fat.CellMarking

fat.SpecifyFixture
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: No embedded table for expected results. at fat.SpecifyFixture.GetExpectedCell(Parse table) at fat.SpecifyFixture.DoTable(Parse table) at fit.Fixture.ProcessTable(Parse table, Fixture activeFixture)

fat.CellMarking
no table

fat.SpecifyFixture
fitlibrary.exception.TableStructureException: This table is invalid for this fixture: No embedded table for expected results. at fat.SpecifyFixture.GetExpectedCell(Parse table) at fat.SpecifyFixture.DoTable(Parse table) at fit.Fixture.ProcessTable(Parse table, Fixture activeFixture)

fat.CellMarking
no table

[exception:specify.no_second_row]fat.SpecifyFixture

[exception:specify.no_input_table]fat.SpecifyFixture
no table

[exception:specify.no_expected_table]fat.SpecifyFixture

fat.CellMarking

[exception:specify.no_expected_table]fat.SpecifyFixture

fat.CellMarking
no table

[exception:specify.no_expected_table]fat.SpecifyFixture

fat.CellMarking
no table

© Copyright 2007,2008 Syterra Software Inc. All rights reserved.