Commit 3abf81c0 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Tests on ParallelStructures: replaced Calc() with CalcSerie(), lots of errors

Showing with 15 additions and 12 deletions
+15 -12
......@@ -57,7 +57,7 @@ export function testStructure(
) {
for (const prm of st.prms) {
if ([ParamCalculability.DICHO, ParamCalculability.EQUATION].includes(prm.calculability)) {
if (prm.symbol === "W" && prm.v === Infinity) {
if (prm.symbol === "W" && prm.currentValue === Infinity) {
// Le calcul de l'ouverture sur les seuils doit renvoyer une exception (cas impossible)
it(`Calc(${prm.symbol}) should return exception`, () => {
expect(
......@@ -65,7 +65,7 @@ export function testStructure(
).toThrow(new Error("Structure:Calc : Calcul de W impossible sur un seuil"));
});
} else {
const ref: number = prm.v;
const ref: number = prm.currentValue;
const res: Result = st.Calc(prm.symbol);
if (bNotZDV) {
// Les lois CEM88D et CUNGE80 ne font pas intervenir ZDV dans le calcul d'un orifice noyé
......@@ -80,7 +80,7 @@ export function testStructure(
checkResult(res, ref);
});
}
prm.v = ref; // Go back to initial value for following tests
// prm.v = ref; // Go back to initial value for following tests
}
}
}
......@@ -121,12 +121,11 @@ export function testParallelStructures(oPS: ParallelStructure, iLoiDebits: numbe
// Tests de calcul des paramètres des ouvrages
for (const prm of st.prms) {
if (
prm.calculability === ParamCalculability.DICHO &&
prm.symbol !== "Z1" && prm.symbol !== "Z2"
) {
const ref: number = prm.currentValue;
prm.v += 100; // Pour éviter de donner la bonne solution en valeur initiale
if (prm.symbol === "W" && prm.v === Infinity) {
if (prm.symbol === "W" && prm.currentValue === Infinity) {
// Le calcul de l'ouverture sur les seuils doit renvoyer une exception (cas impossible)
it(`Calc(${prm.symbol}) should return exception`, () => {
expect(
......@@ -141,7 +140,7 @@ export function testParallelStructures(oPS: ParallelStructure, iLoiDebits: numbe
!oPS.structures[i].isZDVcalculable &&
prm.symbol === "ZDV"
) {
// Les lois CEM88D et CUNGE80 ne font pas intervenir ZDV dans le calcul d'un orifice noyé
// Les lois GateCEM88D et CUNGE80 ne font pas intervenir ZDV dans le calcul d'un orifice noyé
it(`Calc(${prm.symbol}) should return an error`, () => {
expect(
oPS.Calc({
......@@ -163,12 +162,16 @@ export function testParallelStructures(oPS: ParallelStructure, iLoiDebits: numbe
});
} else {
// Cas normal : On teste la valeur calculée
it(`Calc(${prm.symbol}) should return ${ref}`, () => {
checkResult(oPS.Calc({
uid: oPS.structures[i].uid,
symbol: prm.symbol
}), ref);
});
if (ParamCalculability.DICHO === prm.calculability) {
it(`Calc(${prm.symbol}) should return ${ref}`, () => {
oPS.calculatedParam = prm;
checkResult(oPS.CalcSerie(), ref);
/* checkResult(oPS.Calc({
uid: oPS.structures[i].uid,
symbol: prm.symbol
}), ref); */
});
}
}
prm.v = ref; // Go back to initial value for following tests
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment