diff --git a/spec/structure/parallel_structure.spec.ts b/spec/structure/parallel_structure.spec.ts index edacedeea591aec9ef2c5ffc20f7ec903afbfaba..1f2d7d9b9ccbbd7204fe4e28ee0774d245b85bb1 100644 --- a/spec/structure/parallel_structure.spec.ts +++ b/spec/structure/parallel_structure.spec.ts @@ -102,6 +102,16 @@ describe("Class ParallelStructure: ", () => { for (let i = 0; i < ps2.structures.length; i++) { const st: Structure = ps2.structures[i]; describe(`this.structures[${i}]: ${StructureType[iStTypes[i]]} Structure${LoiDebit[iLoiDebits[i]]}: `, () => { + // Tests sur les résultats complémentaires + it(`Calc(Q).extraResults[${i}.Q] should return ${ps2.structures[i].Calc("Q").vCalc}`, () => { + expect( + ps2.Calc("Q").extraResults[`${i}.Q`] + ).toBe( + ps2.structures[i].Calc("Q").vCalc + ); + }); + + // Tests de calcul des paramètres des ouvrages for (const prm of st.prms) { if ( prm.calculability === ParamCalculability.DICHO && @@ -121,7 +131,6 @@ describe("Class ParallelStructure: ", () => { prm.symbol === "ZDV" ) { // Les lois CEM88D et CUNGE80 ne font pas intervenir ZDV dans le calcul d'un orifice noyé - // TODO Il faudrait générer une erreur pour dire que le résultat est indéfini it(`Calc(${prm.symbol}) should return an error`, () => { expect( ps2.Calc(i + "." + prm.symbol).code diff --git a/spec/structure/structure_test.ts b/spec/structure/structure_test.ts index 8fefd6ab17b34b7dde4ccb2600391069ef63b5b1..6ff1af5f39e0eee3857d1fca6445608079c34e18 100644 --- a/spec/structure/structure_test.ts +++ b/spec/structure/structure_test.ts @@ -6,8 +6,9 @@ */ // import { describe, expect, it, xdescribe, xit } from "../mock_jasmine"; +import { MessageCode } from "../../src"; import { ParamCalculability } from "../../src/param/param-definition"; -import { Structure, StructureParams, StructureFlowRegime, StructureFlowMode } from "../../src/structure/structure"; +import { Structure, StructureFlowMode, StructureFlowRegime, StructureParams } from "../../src/structure/structure"; import { Result } from "../../src/util/result"; import { checkResult } from "../test_func"; @@ -77,9 +78,10 @@ export function testStructure( 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é - // TODO Il faudrait générer une erreur pour dire que le résultat est indéfini - xit(`Calc(${prm.symbol}) should return undefined`, () => { - checkResult(res, undefined); + it(`Calc(${prm.symbol}) should return an error`, () => { + expect( + st.Calc(prm.symbol).code + ).toBe(MessageCode.ERROR_STRUCTURE_ZDV_PAS_CALCULABLE); }); } else { // On ne teste pas le calcul de l'ouverture sur les seuils