Fit Specification: Fixtures
Fit do
Sin
Contents:
Comparison
Values Convert to HTML
Loading Fixtures
The first row of a table is always the name of the fixture used to interpret
that table.  Theres no spe
| 
   fat.FixtureNameFixture  | 
  
   | 
 
| 
   Table  | 
  
   FixtureName()  | 
 
| 
   [exampleFixture]  | 
  
   exampleFixture  | 
 
| 
   [exampleFixture] [1] [2] [3] [4]  | 
  
   exampleFixture  | 
 
| 
   [] [exampleFixture]  | 
  
   (missing)  | 
 
| 
   [exampleFixture] [foo]  | 
  
   exampleFixture  | 
 
| 
   [] [exampleFixture]  | 
  
   (missing)  | 
 
The fixture name is the full name of the 
| 
   fat.FixtureLoadFixture  | 
  
   | 
 
| 
   FixtureName  | 
  
   LoadResult()  | 
 
| 
   fat.ExampleFixture  | 
  
   loaded  | 
 
| 
   fat.exampleFixture  | 
  
   error  | 
 
| 
   Fat.ExampleFixture  | 
  
   error  | 
 
| 
   ExampleFixture  | 
  
   error  | 
 
| 
   fat.Example  | 
  
   error  | 
 
Errors
When the fixture isnt valid, Fit annotates the 
This error message may be displayed as part of additional information, su
| 
   fat.FixtureLoadFixture  | 
  
   | 
  
   | 
 
| 
   FixtureName  | 
  
   LoadResult()  | 
  
   ErrorMessage()  | 
 
| 
   fat.ExampleFixture  | 
  
   loaded  | 
  
   (none)  | 
 
| 
   NoSu  | 
  
   error  | 
  
   The fixture
  "NoSu  | 
 
| 
   fat.NotAFixture  | 
  
   error  | 
  
   "fat.NotAFixture
  was found, but its not a fixture.  | 
 
Case-sensitivity errors use the same error message as other not found errors.
| 
   fat.FixtureLoadFixture  | 
  
   | 
  
   | 
 
| 
   FixtureName  | 
  
   LoadResult()  | 
  
   ErrorMessage()  | 
 
| 
   fat.exampleFixture  | 
  
   error  | 
  
   The fixture "fat.exampleFixture" was not found.  | 
 
NOTE TO IMPLEMENTORS:
The remainder of this do
Interpreting Tables
By default, fixtures interpret tables from left to right and top to bottom.
| 
   fat.InterpretationOrderFixture  | 
  
   | 
 
| 
   Table  | 
  
   InterpretationOrder()  | 
 
| 
   [fat.Con [top left] [top middle] [top right] [bottom left] [bottom middle] [bottom right]  | 
  
   top left, top middle, top right, bottom left, bottom middle, bottom right  | 
 
Although left-to-right and top-to-bottom is the default, fixtures may
interpret tables in any order they please. 
The fixture in the following example interprets tables 
| 
   fat.InterpretationOrderFixture  | 
  
   | 
 
| 
   Table  | 
  
   InterpretationOrder()  | 
 
| 
   [fat.ReverseCon [top left] [top middle] [top right] [bottom left] [bottom middle] [bottom right]  | 
  
   top right, bottom right, top middle, bottom middle, top left, bottom left  | 
 
Default Interpretation
Fits default interpretation of a 
| 
   fat.InterpreterFixture  | 
  
   | 
  
   | 
 
| 
   InputTable  | 
  
   InterpretedTable()  | 
  
   RenderedOutput()  | 
 
| 
   [fat.DoNothingFixture] [left] [right]  | 
  
   <table> <tr><td>fat.DoNothingFixture</td></tr>   <tr><td bg </table>  | 
  
   | 
 
If an error o
| 
   ??  | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   | 
  
   | 
  
   | 
  
   | 
  
   | 
 
Fixtures may override the default interpretation and do whatever they
wish.  The fixture in the following
example marks all 
| 
   ??  | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   | 
  
   | 
  
   | 
  
   | 
  
   | 
 
Chec king
Cells
Fit provides a standard servi
Right and Wrong
When the table 
| 
   fat.Che  | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
 
| 
   <td>Something</td>  | 
  
   Something  | 
  
   right  | 
 
When they dont mat
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Expe  | 
  
   A  | 
 
| 
   <td>Something</td>  | 
  
   Something else  | 
  
   wrong  | 
  
   Something  | 
  
   Something else  | 
 
Empty Cells
If the table 
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Info()  | 
 
| 
   <td></td>  | 
  
   Anything  | 
  
   info  | 
  
   Anything  | 
 
Unexpec ted
Errors
If an error o
The following examples use the keyword (
| 
   fat.Che  | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
 
| 
   <td>something</td>  | 
  
   (  | 
  
   error  | 
 
If the table 
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Info()  | 
 
| 
   <td></td>  | 
  
   (  | 
  
   info  | 
  
   error  | 
 
Expec ted
Errors
If the table 
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Expe  | 
  
   A  | 
 
| 
   <td>error</td>  | 
  
   (  | 
  
   right  | 
  
   n/a  | 
  
   n/a  | 
 
| 
   <td>error</td>  | 
  
   Anything  | 
  
   wrong  | 
  
   error  | 
  
   Anything  | 
 
Expec ted
Blank
Fit does not support
a standard blank keyword similar to the error keyword.  (Although the following example uses a
(blank) keyword to indi
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Expe  | 
  
   A  | 
  
   Info()  | 
 
| 
   <td>blank</td>  | 
  
   (blank)  | 
  
   wrong  | 
  
   blank  | 
  
   (blank)  | 
  
   n/a  | 
 
| 
   <td>blank</td>  | 
  
   Anything  | 
  
   wrong  | 
  
   blank  | 
  
   Anything  | 
  
   n/a  | 
 
| 
   <td></td>  | 
  
   (blank)  | 
  
   info  | 
  
   n/a  | 
  
   n/a  | 
  
   (blank)  | 
 
| 
   <td></td>  | 
  
   Anything  | 
  
   info  | 
  
   n/a  | 
  
   n/a  | 
  
   Anything  | 
 
If a fixture wishes to allow blank values, it must handle
this on its own.  A 
Cell HTML Converts to Text
The 
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Expe  | 
  
   A  | 
 
| 
   <td><i>anything</i></td>  | 
  
   anything  | 
  
   right  | 
  
   n/a  | 
  
   n/a  | 
 
| 
   <td><i>anything</i></td>  | 
  
   <i>anything</i>  | 
  
   wrong  | 
  
   anything  | 
  
   <i>anything</i>  | 
 
| 
   <td><i>anything</i></td>  | 
  
   <i>anything</i>  | 
  
   right  | 
  
   n/a  | 
  
   n/a  | 
 
| 
   <td><i>anything</i></td>  | 
  
   anything  | 
  
   wrong  | 
  
   <i>anything</i>  | 
  
   anything  | 
 
This 
| 
   fat.Che  | 
  
   | 
  
   | 
  
   | 
 
| 
   Cell  | 
  
   ComparisonValue  | 
  
   Annotation()  | 
  
   Info()  | 
 
| 
   <td> </td>  | 
  
   anything  | 
  
   info  | 
  
   anything  | 
 
| 
   <td><font   | 
  
   (  | 
  
   right  | 
  
   n/a  | 
 
Comparison Values Convert to HTML
When a 
Type Conversion
(to do)
Converting strings to obje
Converting obje
Comparing obje
Predefined Fixtures
Fit in
| 
   fat.Referen  | 
  
   | 
  
   | 
 
| 
   Des  | 
  
   Lo  | 
  
   Result()  | 
 
| 
   Primitive Fixture  | 
  
   primitive-fixture.html  | 
  
   | 
 
| 
   Column Fixture  | 
  
   | 
  
   | 
 
| 
   Row Fixture  | 
  
   row-fixture.html  | 
  
   | 
 
| 
   A  | 
  
   a  | 
  
   | 
 
| 
   Summary Fixture  | 
  
   summary-fixture.html  | 
  
   | 
 
Run Results
| 
   fit.Summary  | 
 
(to do)
Be sure to in
Che
Expe
| 
   fat.Equals  | 
 |||
| 
   type  | 
  
   x  | 
  
   y  | 
  
   =  | 
 
| 
   boolean  | 
  
   true  | 
  
   TRUE  | 
  
   true  | 
 
| 
   integer  | 
  
   00001  | 
  
   1  | 
  
   true  | 
 
| 
   real  | 
  
   1000  | 
  
   1e3  | 
  
   true  | 
 
| 
   string  | 
  
   ab  | 
  
   ABC  | 
  
   false  | 
 
| 
   string  | 
  
   a b   | 
  
   a b   | 
  
   true  | 
 
A sequen
| 
   fat.Equals  | 
  
   | 
  
   | 
  
   | 
 
| 
   type  | 
  
   x  | 
  
   y  | 
  
   =  | 
 
| 
   integers  | 
  
   1, 3, 5  | 
  
   01,03,05  | 
  
   true  | 
 
| 
   integers  | 
  
   1, 3, 5  | 
  
   01,05,03  | 
  
   false  | 
 
| 
   booleans  | 
  
   true, true, false  | 
  
   true, false  | 
  
   false  | 
 
| 
   strings  | 
  
   a , b ,   | 
  
   a,b,  | 
  
   true  | 
 
Domain values 
| 
   fat.Equals  | 
 |||
| 
   type  | 
  
   x  | 
  
   y  | 
  
   =  | 
 
| 
   date  | 
  
   Jan 1, 1995  | 
  
   January 1, 1995  | 
  
   true  | 
 
| 
   money  | 
  
   $10000  | 
  
   $10,000.00  | 
  
   true  | 
 
Floating point numbers are 
· non-zeros -- 123.45 is 5 digits
· zeros between non-zeros -- 100003 is 6 digits
·        
zeros in the fra
· but not leading zeros -- 0001000 is 4 digits
· and not exponent digits -- 6.02e23 is 3 digits
·        
left argument (re
| 
   fat.Equals  | 
 |||
| 
   type  | 
  
   x  | 
  
   y  | 
  
   =  | 
 
| 
   real  | 
  
   123.45  | 
  
   123.449  | 
  
   false  | 
 
| 
   s  | 
  
   123.45  | 
  
   123.449  | 
  
   true  | 
 
| 
   s  | 
  
   100003  | 
  
   100003.1  | 
  
   true  | 
 
| 
   s  | 
  
   100003.1  | 
  
   100003  | 
  
   false  | 
 
| 
   s  | 
  
   12.20  | 
  
   12.210  | 
  
   false  | 
 
| 
   s  | 
  
   12.21  | 
  
   12.210  | 
  
   true  | 
 
Improperly spe
· xyz is not an integer
· 10000000000000000000000000 may or may not be an integer
| 
   fat.Table  | 
 |
| 
   fat.Equals  | 
  
   
  | 
 
| 
   type  | 
  
   x  | 
 
| 
   integer  | 
  
   200  | 
 
| 
   integer  | 
  
   xyz  | 
 
| 
   fat.Color  | 
 |
| 
   white  | 
  
   white  | 
 
| 
   white  | 
  
   white  | 
 
| 
   white  | 
  
   white  | 
 
| 
   white  | 
  
   yellow  | 
 
Some 
·        
blank -- omit 
·        
error -- expe
| 
   fat.Table  | 
 ||
| 
   fat.Divide  | 
  
   
  | 
  
   
  | 
 
| 
   x  | 
  
   y  | 
  
   divide()  | 
 
| 
   100  | 
  
   2  | 
  
   50  | 
 
| 
   100  | 
  
   2  | 
  
   
  | 
 
| 
   100  | 
  
   0  | 
  
   error  | 
 
| 
   100  | 
  
   0  | 
  
   
  | 
 
| 
   fat.Color  | 
 ||
| 
   white  | 
  
   white  | 
  
   white  | 
 
| 
   white  | 
  
   white  | 
  
   white  | 
 
| 
   white  | 
  
   white  | 
  
   green  | 
 
| 
   white  | 
  
   white  | 
  
   gray/white  | 
 
| 
   white  | 
  
   white  | 
  
   green  | 
 
| 
   white  | 
  
   white  | 
  
   gray/white  | 
 
The framework looks for parse support in different pla
· fixture
·        
domain obje
· type adapter
The framework will allow fixtures to implement 
· yea = true
· nay = false
Fixture
By default 
·        
doTables -- sequen
· doTable -- interpret a table
·        
doRows -- sequen
· doRow -- interpret a row
·        
doCells -- sequen
· doCell -- interpret a row
The default interpretation of a 
Cells 
·        
white -- no 
·        
green -- right: expe
·        
red -- wrong: expe
·        
yellow -- ex
·        
gray -- ignore: desired 
Fixtures 
·        
·        
·        
runner fixtures (e.g. AllFiles) 
Fixtures 
· state variables
· state lifetime
· state summary
The primitive fixture does not depend on TypeAdapter. Type spe
·        
·        
·        
·        
A 
· name is setter or field
· name() is getter or field
·        
·        
depre
A row fixture expe
· name is field or getter
· name() is getter
·        
Rows are mat
·        
some given, none a
·        
none given, some a
·        
one given, one a
·        
many given, many a
Missing and surplus rows are marked as su
·        
ea
· surplus rows added to table in gray
An a
· enter -- put given in setter or field
·        
·        
press -- 
·        
start -- new a
An a
·        
a
·        
initial a
·        
start with no argument spe
Start 
·        
·        
return to an existing a
Other a
·        
repla
·        
repla
·        
restore the previous a
Sub
·        
Runner
A runner 
·        
top-level fixture is instan
A runner retrieves and disposes of do
· input-file only -- default output
·        
input-file output-file -- spe
·        
input-dire
·        
input-dire
· index.html result summaries
· - is standard in/out
A runner signals the presen
·        
exit status is sum of wrong and ex
·        
main is fa
A runner establishes run spe
· [?]AssemblyPath ???