diff --git a/spec/structure/functions.ts b/spec/structure/functions.ts index cb7dfc4dac08ba17787efb750177e8d98a01170a..8b9ec809f9c7fcfba9d32a46b63baccb88f76643 100644 --- a/spec/structure/functions.ts +++ b/spec/structure/functions.ts @@ -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 }