[
{ "name": "duo pitch, 8 m span, 2 m rise: run 4, tan 0.5", "args": [8, 2, 10, "duo"], "expect": { "pitchDegrees": 26.57, "rafterLength": 4.472, "roofArea": 89.44 } },
{ "name": "rise equal to the run is 45 degrees", "args": [6, 3, 5, "duo"], "expect": { "pitchDegrees": 45, "rafterLength": 4.243, "roofArea": 42.43 } },
{ "name": "a 3-4-5 triangle gives an exact 5 m rafter", "args": [8, 3, 12, "duo"], "expect": { "pitchDegrees": 36.87, "rafterLength": 5, "roofArea": 120 } },
{ "name": "area from the unrounded rafter: 4.32666 x 40 is 173.07, not 4.327 x 40 = 173.08", "args": [7.2, 2.4, 20, "duo"], "expect": { "pitchDegrees": 33.69, "rafterLength": 4.327, "roofArea": 173.07 } },
{ "name": "a rise of 2.887 on a 10 m span is a 30 degree roof", "args": [10, 2.887, 8, "duo"], "expect": { "pitchDegrees": 30, "rafterLength": 5.774, "roofArea": 92.38 } },
{ "name": "steep duo pitch: tan 6", "args": [2, 6, 1, "duo"], "expect": { "pitchDegrees": 80.54, "rafterLength": 6.083, "roofArea": 12.17 } },
{ "name": "mono pitch uses the whole span as the run and has one slope", "args": [4, 1, 3, "mono"], "expect": { "pitchDegrees": 14.04, "rafterLength": 4.123, "roofArea": 12.37 } },
{ "name": "shallow lean-to", "args": [9.6, 1.2, 15.5, "mono"], "expect": { "pitchDegrees": 7.13, "rafterLength": 9.675, "roofArea": 149.96 } },
{ "name": "zero rise is a flat roof: pitch 0, rafter equal to the run", "args": [5, 0, 4, "mono"], "expect": { "pitchDegrees": 0, "rafterLength": 5, "roofArea": 20 } },
{ "name": "the same span as a duo pitch halves the run", "args": [8, 2, 10, "mono"], "expect": { "pitchDegrees": 14.04, "rafterLength": 8.246, "roofArea": 82.46 } },
{ "name": "a zero span is an error", "args": [0, 2, 10, "duo"], "expectError": "span must be a finite number of metres" },
{ "name": "a negative rise is an error", "args": [8, -1, 10, "duo"], "expectError": "rise must be a finite number of metres" },
{ "name": "a zero roof length is an error", "args": [8, 2, 0, "duo"], "expectError": "roofLength must be a finite number of metres" },
{ "name": "a span given as text is an error", "args": ["8", 2, 10, "duo"], "expectError": "span must be a finite number of metres" },
{ "name": "an unknown roof type is an error", "args": [8, 2, 10, "hip"], "expectError": "unknown roof type \"hip\"" }
]