Forked from HYCAR-Hydro / airGR
Source project has a limited visibility.
lechaptcalmon.spec.ts 2.26 KiB
/// <reference path="../node_modules/@types/jasmine/index.d.ts" />
import { LechaptCalmonParams, LechaptCalmon } from "../src/lechaptcalmon"
import { checkResult } from "./test_func";
let lechapt: LechaptCalmon;
let prms: LechaptCalmonParams;
describe('Class LechaptCalmon : ', () => {
    describe('Calc() : ', () => {
        it('Q should be 2.917', () => {
            prms = new LechaptCalmonParams(undefined, // débit
                1.2, // diamètre
                0.6, /// perte de charge
                100, // longueur du toyo
                1.863, // paramètre L du matériau
                2, // paramètre M du matériau
                5.33// paramètre N du matériau
            lechapt = new LechaptCalmon(prms);
            checkResult(lechapt.Calc("Q"), 2.917);
        });
        it('D should be 1.213', () => {
            prms = new LechaptCalmonParams(3, // débit
                undefined, // diamètre
                0.6, /// perte de charge
                100, // longueur du toyo
                1.863, // paramètre L du matériau
                2, // paramètre M du matériau
                5.33// paramètre N du matériau
            lechapt = new LechaptCalmon(prms);
            checkResult(lechapt.Calc("D"), 1.213);
        });
        it('J should be 0.634', () => {
            prms = new LechaptCalmonParams(3, // débit
                1.2, // diamètre
                undefined, /// perte de charge
                100, // longueur du toyo
                1.863, // paramètre L du matériau
                2, // paramètre M du matériau
                5.33// paramètre N du matériau
            lechapt = new LechaptCalmon(prms);
            checkResult(lechapt.Calc("J"), 0.634);
        });
        it('Lg should be 94.565', () => {
            prms = new LechaptCalmonParams(3, // débit
                1.2, // diamètre
                0.6, /// perte de charge
                undefined, // longueur du toyo
                1.863, // paramètre L du matériau
                2, // paramètre M du matériau
                5.33// paramètre N du matériau
            lechapt = new LechaptCalmon(prms);
            checkResult(lechapt.Calc("Lg"), 94.565);
        });
    });
});