Skip to content
Snippets Groups Projects
Commit 6469d678 authored by Dorchies David's avatar Dorchies David
Browse files

test: Debug add Cunge80 in Cloisons

Refs #220
parent 0bf3e568
No related branches found
No related tags found
No related merge requests found
import { CreateStructure, LoiDebit, MessageCode, Session } from "../../src/index";
import { CreateStructure, MessageCode, Session } from "../../src/index";
import { LoiDebit } from "../../src/structure/structure_props";
import { Cloisons } from "../../src/pab/cloisons";
import { CloisonsParams } from "../../src/pab/cloisons_params";
import { RectangularStructureParams } from "../../src/structure/rectangular_structure_params";
......@@ -52,7 +53,7 @@ describe("Class Cloisons: ", () => {
});
describe("testPS", () => {
testParallelStructures(CreateParalleleStructureTest(getEmptyCloisonsTest()));
testParallelStructures(CreateParalleleStructureTest(getEmptyCloisonsTest(), [LoiDebit.GateCunge80]));
});
describe("Exemple Formation Cassiopée 2018-09", () => {
......
......@@ -7,7 +7,7 @@ import { Result } from "../../src/util/result";
import { precDigits } from "../test_config";
import { checkResult } from "../test_func";
export function CreateParalleleStructureTest(parallelStructure: ParallelStructure):
export function CreateParalleleStructureTest(parallelStructure: ParallelStructure, exceptLoiDebit?: LoiDebit[]):
{ps: ParallelStructure, ld: number[]} {
// Ajout d'une structure de chaque type dans ParallelStructure
const loiDebits: number[] = [];
......@@ -16,8 +16,10 @@ export function CreateParalleleStructureTest(parallelStructure: ParallelStructur
const loiAdmStruct = loisAdmissibles[StructureType[s]];
if (loiAdmStruct !== undefined) {
for (const la of loiAdmStruct) {
parallelStructure.addChild(CreateStructure(la, parallelStructure, false));
loiDebits.push(la);
if(exceptLoiDebit === undefined || !exceptLoiDebit.includes(la)) {
parallelStructure.addChild(CreateStructure(la, parallelStructure, false));
loiDebits.push(la);
}
}
}
}
......@@ -189,7 +191,7 @@ export function testParallelStructures(o: { ps: ParallelStructure, ld: number[]
} else {
// Cas normal : On teste la valeur calculée
if (ParamCalculability.DICHO === prm.calculability) {
fit(`should return ${ref}`, () => {
it(`should return ${ref}`, () => {
// console.log(o.ps.serialise());
checkResult(o.ps.CalcSerie(), ref);
/* checkResult(o.ps.Calc({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment