[TestMethod]
public void TestCasesSixteenToTwenty()
{
    // inputs for test cases 16 to 20
    double[] tempIn = new double[] { 40.5d, 3.9d, 55.0d, 5.0d, -14.5d, };
    double[] pressIn = new double[] { 1645.0d, 1125.0d, 348.0d, 1500.0d, 4260.0d };
    double[] vapourPressIn = new double[] { 738.0d, 1125.0d, 213.0d, 494.0d, 1650.0d, };
    double[] densIn = new double[] { 544.5d, 402.0d, 632.0d, 512.5d, 356.5d };
    double[] volIn = new double[] { 60.0d, 15.0d, 100.0d, 250.0d, 150.0d, };
    // expected values from D017
    double[] ctlVolExpected = new double[] { 56.184942d, 15.889672d, 93.586521d, 256.830532d, 181.173148d, };
    double[] ctlCplVolExpected = new double[] { 56.488356d, 15.889672d, 93.623473d, 257.880793d, 185.235683d, };
    double[] ctlExpected = new double[] { 0.93642d, 1.05931d, 0.93587d, 1.02732d, 1.20782d, };
    double[] cplExpected = new double[] { 1.0054d, 1.0000d, 1.0004d, 1.0041d, 1.0224d, };
    double[] volExpected = new double[] { 56.5d, 15.9d, 93.6d, 257.9d, 185.2d, };

    // get base temp in F
    double tBase = UnitsHelpers.ConvertUnits(15.0d, AllUnits.celsius, AllUnits.fahrenheit);

    int testCase;

    for (int i = 0; i < tempIn.Length; i++)
    {
        testCase = 16 + i;
        // convert values to standard units
        // algorithm requires inputs in standard units
        double t = UnitsHelpers.ConvertUnits(tempIn[i], AllUnits.celsius, AllUnits.fahrenheit);
        double p = UnitsHelpers.ConvertUnits(pressIn[i], AllUnits.kPa, AllUnits.psi);

        // API algorithms can only correct to 60 F. So we
        // first correct the given density from the test case
        // at 15 C (59 F) to 60 F
        double gammaIn = densIn[i] / 999.016d;
        // get gamma at 60 F from 59 F
        double gamma60F = Mpms11NglReverse.GetCorrectedDensity(gammaIn, 59.0d, 60.0d).Item3;
        // calculate the input density from the corrected gamma at 60 F
        double densIn60F = gamma60F * 999.016;
        // calculate CTL at flowing conditions using the input density at 60 F
        double ctl60F = Mpms11Ngl.CalcCtl(gamma60F, t);
        // get the flowing density based on 60 F
        double densityFlowing = ctl60F * densIn60F;
        // get ctl at 15 C = 59 F
        double ctl = densityFlowing / densIn[i];

        // convert input vapour pressure from kPa to psi
        double vapourPressure = UnitsHelpers.ConvertUnits(vapourPressIn[i], AllUnits.kPa, AllUnits.psi);
        // calculate CPL
        double cpl = Mpms11NglPressure.CalcPressureCorr(gamma60F, t, p, vapourPressure);

        // calculate output values and diffs
        double ctlRounded = Math.Round(ctl, 5);
        double ctlDiffPercent = (Math.Abs(ctlExpected[i] - ctlRounded) / ctlExpected[i]) * 100.0d;

        double cplRounded = Math.Round(cpl, 4);
        double cplDiffPercent = (Math.Abs(cplExpected[i] - cplRounded) / cplExpected[i]) * 100.0d;

        double volCtl = volIn[i] * ctl;
        double volCtlRounded = Math.Round(volCtl, 6);
        double volCtlDiffPercent = (Math.Abs(ctlVolExpected[i] - volCtlRounded) / ctlVolExpected[i]) * 100.0d;

        double volCtlCpl = volIn[i] * ctl * cpl;
        double volCtlCplRounded = Math.Round(volCtlCpl, 6);
        double volCtlCplDiffPercent = (Math.Abs(ctlCplVolExpected[i] - volCtlCplRounded) / ctlCplVolExpected[i]) * 100.0d;

        double volCalcRounded = Math.Round(volCtlCpl, 1);
        double volExpectedDiffPercent = (Math.Abs(volExpected[i] - volCalcRounded) / volExpected[i]) * 100.0d;

        Console.WriteLine($"[{testCase:00}]");
        Console.WriteLine($"\tCTL expected {ctlExpected[i]}, CTL calculated {ctlRounded}, diff {ctlDiffPercent} (%)");
        Console.WriteLine($"\tCPL expected {cplExpected[i]}, CPL calculated {cplRounded}, diff {cplDiffPercent} (%)");
        Console.WriteLine($"\tCTL vol expected {ctlVolExpected[i]} (m3), CTL vol calculated {volCtlRounded} (m3), diff {volCtlDiffPercent} (%)");
        Console.WriteLine($"\tCTL CPL vol expected {ctlCplVolExpected[i]} (m3), CTL CPL vol calculated {volCtlCplRounded} (m3), diff {volCtlCplDiffPercent} (%)");
        Console.WriteLine($"\tVol expected {volExpected[i]} (m3), vol calculated {volCalcRounded} (m3), diff {volExpectedDiffPercent} (%)");
        Console.WriteLine();
    }
}