From 67e18e46ac602f3f515ed93f843f98094ba74f93 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Wed, 22 May 2019 10:15:47 +0200
Subject: [PATCH] Added 1 test

---
 spec/param/param_modes.spec.ts | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/spec/param/param_modes.spec.ts b/spec/param/param_modes.spec.ts
index 0b6d2570..b01100c4 100644
--- a/spec/param/param_modes.spec.ts
+++ b/spec/param/param_modes.spec.ts
@@ -317,3 +317,34 @@ describe("cohérence des modes de paramètres : ", () => {
         }
     });
 });
+
+describe("Structure and calculated parameter(s) : ", () => {
+    it ("when all other params are linked, changing Structure should not lead to > 1 param. in CALC mode", () => {
+        const pc1 = new CloisonsParams(1.5, 102, 10, 1, 1, 0.5);
+        const c1 = new Cloisons(pc1);
+        c1.addChild(CreateStructure(LoiDebit.OrificeSubmerged, c1));
+
+        const pc2 = new CloisonsParams(1.5, 102, 10, 1, 1, 0.5);
+        const c2 = new Cloisons(pc2);
+        const c2s1 = CreateStructure(LoiDebit.OrificeSubmerged, c2);
+        c2.addChild(c2s1);
+
+        Session.getInstance().clear();
+        Session.getInstance().registerNub(c1);
+        Session.getInstance().registerNub(c2);
+
+        pc2.Q.defineReference(c1, "Q");
+        pc2.Z1.defineReference(c1, "Z1");
+        pc2.LB.defineReference(c1, "LB");
+        pc2.BB.defineReference(c1, "BB");
+        pc2.PB.defineReference(c1, "PB");
+        pc2.DH.defineReference(c1, "DH");
+
+        checkConsistency(c2);
+
+        const c2s2 = CreateStructure(LoiDebit.KIVI, c2);
+        c2.replaceChildInplace(c2s1, c2s2);
+
+        checkConsistency(c2);
+    });
+});
-- 
GitLab