Commit fb0cfd4e authored by Grand Francois's avatar Grand Francois
Browse files

test: add submergence check for WeirSubmerged discharge law

refs #302
Showing with 15 additions and 4 deletions
+15 -4
......@@ -35,10 +35,9 @@ describe("Class StructureWeirSubmerged: ", () => {
structTest.prms.Z2.singleValue = 105;
structTest.prms.ZDV.singleValue = 100;
const res = structTest.CalcSerie().resultElement;
expect(res.log.messages.length).toBe(1);
expect(
res.log.messages[0].code
).toBe(MessageCode.WARNING_WEIR_SUBMERGENCE_LOWER_THAN_08);
expect(res.log.messages.length).toBe(2);
const ok = res.log.messages[0].code === MessageCode.WARNING_WEIR_SUBMERGENCE_LOWER_THAN_08 || res.log.messages[1].code === MessageCode.WARNING_WEIR_SUBMERGENCE_LOWER_THAN_08;
expect(ok).toBe(true);
});
});
});
......@@ -54,4 +54,16 @@ describe("Class StructureWeirSubmergedLarinier: ", () => {
).toBe(MessageCode.WARNING_SLOT_SUBMERGENCE_NOT_BETWEEN_07_AND_09);
});
});
describe("Calcul avec h2/h1 < 0.5 (=0.4) : ", () => {
it("le log devrait contenir au moins un message d'erreur", () => {
const structTest = getStructTest();
structTest.prms.Z1.singleValue = 110;
structTest.prms.Z2.singleValue = 104;
structTest.prms.ZDV.singleValue = 100;
const res = structTest.CalcSerie().resultElement;
expect(res.log.messages.length).toBe(2);
const ok = res.log.messages[0].code === MessageCode.ERROR_STRUCTURE_SUBMERGENCE_LOWER_THAN || res.log.messages[1].code === MessageCode.ERROR_STRUCTURE_SUBMERGENCE_LOWER_THAN;
expect(ok).toBe(true);
});
});
});
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