An error occurred while loading the file. Please try again.
-
Dorchies David authored
#38 Correction pour tests unitaires suite au changement d'initialisation de la dichotomie dans 99b9bef6
5499450d
// tslint:disable-next-line:no-reference
/// <reference path="../node_modules/@types/jasmine/index.d.ts" />
import { ConduiteDistrib, ConduiteDistribParams } from "../src/cond_distri";
import { checkResult } from "./test_func";
describe("Class ConduiteDistrib: ", () => {
// beforeEach(() => {
// });
// beforeAll(() => {
// });
describe("Calc(): ", () => {
it("Q should be 9.393", () => {
const prms = new ConduiteDistribParams(undefined, // débit Q
1.2, // diamètre D
0.6, // perte de charge J
100, // Longueur de la conduite Lg
1e-6, // Viscosité dynamique Nu
);
const nub = new ConduiteDistrib(prms);
checkResult(nub.Calc("Q", 0), 9.393);
});
});
describe("Calc(): ", () => {
it("Q should be 152.992", () => {
const prms = new ConduiteDistribParams(undefined, // débit Q
2, // diamètre D
0.7, // perte de charge J
10, // Longueur de la conduite Lg
1e-6, // Viscosité dynamique Nu
);
const nub = new ConduiteDistrib(prms);
nub.prms.D.v = 2;
nub.prms.J.v = 0.7;
nub.prms.Lg.v = 10;
nub.prms.Nu.v = 1e-6;
checkResult(nub.Calc("Q", 0), 152.992);
});
});
describe("Calc(): ", () => {
it("D should be 2.12847", () => {
const prms = new ConduiteDistribParams(3, // débit Q
undefined, // diamètre D
0.7, // perte de charge J
10, // Longueur de la conduite Lg
1e-6, // Viscosité dynamique Nu
);
const nub = new ConduiteDistrib(prms);
checkResult(nub.Calc("D", 0), 2.12847);
});
});
describe("Calc(): ", () => {
it("J should be 0.00814", () => {
const prms = new ConduiteDistribParams(3, // débit Q
1.2, // diamètre D
undefined, // perte de charge J
10, // Longueur de la conduite Lg
1e-6, // Viscosité dynamique Nu
);
7172737475767778798081828384858687888990919293949596979899100101102103104105106107
const nub = new ConduiteDistrib(prms);
checkResult(nub.Calc("J", 0), 0.00814);
});
});
describe("Calc(): ", () => {
it("Lg should be 737.021", () => {
const prms = new ConduiteDistribParams(3, // débit Q
1.2, // diamètre D
0.6, // perte de charge J
undefined, // Longueur de la conduite Lg
1e-6, // Viscosité dynamique Nu
);
const nub = new ConduiteDistrib(prms);
checkResult(nub.Calc("Lg", 0), 737.021);
});
});
describe("Calc(): ", () => {
it("Nu should be 0.00295", () => {
const prms = new ConduiteDistribParams(3, // débit Q
1.2, // diamètre D
0.6, // perte de charge J
100, // Longueur de la conduite Lg
undefined, // Viscosité dynamique Nu
);
const nub = new ConduiteDistrib(prms);
checkResult(nub.Calc("Nu", 0), 0.00295);
});
});
});