39.2. Calculator RunnerIn this example, the test data is already in a textual form, and it is convenient to leave it in that form. However, it would be handy to be able to run the tests, using Fit, and to present the results as an HTML report along with a summary. For our example, we will write a runner that will read in the test data from a file and create internal Fit tables. After running the tests in the tables, a report is written out in HTML, as usual. The file data format is a sequence of comma-separated numbers, with three per line. Here's a sample:
The report we want will have two tables, as shown in Figure 39.1. In the first table, the calculated column returns the sum of a and b, using Sum, a ColumnFixture. So we need to generate the first two rows of the table in our runner, followed by a row for each line in our file. The second table simply consists of a single row for the fixture name, fit.Summary; extra rows are added in the report. Figure 39.1. Fit Report for TestDiscount
|