Section 20.2. Fixtures and Traffic Lights


20.2. Fixtures and Traffic Lights

When it runs a table, Fit creates an object of the fixture class and passes control to that object, calling its method doTable(). The fixture carries out the tests, coloring the reported table so that we can tell which tests passed and which failed. As introduced in Section 3.2 on p. 14, the cell colors are as follows:

  • Green: when an expected value matches the actual value from the system under test.

  • Red: when a cell fails to meet expectations. Additional information may be provided: the actual value received, in a ColumnFixture or an ActionFixture; or the fact that a row was missing from the actual list, in the case of RowFixture.

  • Yellow: when a value is of the wrong format, cells are missing, or an exception is thrown in the fixture or system under test.

  • Gray: for a cell that was for some reason not processed.

Questions & Answers

Q1:

What if the fixture class that is named in a table doesn't exist?

A1:

An exception is thrown and is reported in the first cell of the table.

Q2:

How about testing other languages?

A2:

Besides Java, there are versions of Fit for several programming languages, including C#, Visual Basic.net, C++, Ruby, Python, and Smalltalk. In general, the same Fit table can be used with several programming languages, although the fixture code will be different.



    Fit for Developing Software. Framework for Integrated Tests
    Fit for Developing Software: Framework for Integrated Tests
    ISBN: 0321269349
    EAN: 2147483647
    Year: 2005
    Pages: 331

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net