Commit e56c38f3 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Updated tests for Karma

Showing with 10 additions and 112 deletions
+10 -112
import { ParamValueMode, SectionParametree, Session } from "../../src";
import { ConduiteDistrib, ConduiteDistribParams } from "../../src/cond_distri";
import { ParamValueMode, SectionParametree, Session } from "../../src/index";
import { CourbeRemous, CourbeRemousParams, MethodeResolution } from "../../src/remous";
import { cSnCirc, ParamsSectionCirc } from "../../src/section/section_circulaire";
import { cSnTrapez, ParamsSectionTrapez } from "../../src/section/section_trapez";
......@@ -139,9 +139,9 @@ describe("serialising / deserialising session - ", () => {
});
it ("loaded serialized RegimeUniforme should be calculable", () => {
const fs = require("fs");
Session.getInstance().clear();
const session = fs.readFileSync(__dirname + "/../../../spec/session/session-RU.json", { encoding: "utf8" });
// tslint:disable-next-line:max-line-length
const session = `{"session":[{"uid":"YTEwZG","props":{"calcType":3,"nodeType":2},"meta":{"title":"R. uniforme"},"children":[{"uid":"NDcxN3","props":{"calcType":14,"nodeType":2},"children":[],"parameters":[{"symbol":"Pr","mode":"SINGLE","value":0.0001},{"symbol":"Ks","mode":"SINGLE","value":40},{"symbol":"Q","mode":"CALCUL"},{"symbol":"If","mode":"SINGLE","value":0.001},{"symbol":"YB","mode":"SINGLE","value":1},{"symbol":"Y","mode":"SINGLE","value":0.89},{"symbol":"LargeurBerge","mode":"SINGLE","value":2.5}]}],"parameters":[{"symbol":"Pr","mode":"SINGLE","value":0.0001}]}]}`;
Session.getInstance().unserialise(session);
expect(Session.getInstance().getNumberOfNubs()).toBe(1);
......@@ -165,9 +165,9 @@ describe("serialising / deserialising session - ", () => {
});
it ("loaded serialized Ouvrages should be calculable", () => {
const fs = require("fs");
Session.getInstance().clear();
const session = fs.readFileSync(__dirname + "/../../../spec/session/session-OUV.json", { encoding: "utf8" });
// tslint:disable-next-line:max-line-length
const session = `{"session":[{"uid":"NGVzdz","props":{"calcType":8,"nodeType":0},"meta":{"title":"Ouvrages"},"children":[{"uid":"Z2F4dz","props":{"calcType":7,"nodeType":5,"structureType":1,"loiDebit":1},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":100},{"symbol":"W","mode":"SINGLE","value":0.5},{"symbol":"L","mode":"SINGLE","value":2},{"symbol":"Cd","mode":"SINGLE","value":0.6}]},{"uid":"ZDR4cX","props":{"calcType":7,"nodeType":5,"structureType":1,"loiDebit":1},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":100},{"symbol":"W","mode":"SINGLE","value":0.5},{"symbol":"L","mode":"CALCUL"},{"symbol":"Cd","mode":"SINGLE","value":0.6}]}],"parameters":[{"symbol":"Pr","mode":"SINGLE","value":0.0001},{"symbol":"Q","mode":"SINGLE","value":3.5},{"symbol":"Z1","mode":"SINGLE","value":102},{"symbol":"Z2","mode":"SINGLE","value":101.5}]}]}`;
Session.getInstance().unserialise(session);
expect(Session.getInstance().getNumberOfNubs()).toBe(1);
......
{
"session": [
{
"uid": "NGVzdz",
"props": {
"calcType": 8,
"nodeType": 0
},
"meta": {
"title": "Ouvrages"
},
"children": [
{
"uid": "Z2F4dz",
"props": {
"calcType": 7,
"nodeType": 5,
"structureType": 1,
"loiDebit": 1
},
"children": [],
"parameters": [
{
"symbol": "ZDV",
"mode": "SINGLE",
"value": 100
},
{
"symbol": "W",
"mode": "SINGLE",
"value": 0.5
},
{
"symbol": "L",
"mode": "SINGLE",
"value": 2
},
{
"symbol": "Cd",
"mode": "SINGLE",
"value": 0.6
}
]
},
{
"uid": "ZDR4cX",
"props": {
"calcType": 7,
"nodeType": 5,
"structureType": 1,
"loiDebit": 1
},
"children": [],
"parameters": [
{
"symbol": "ZDV",
"mode": "SINGLE",
"value": 100
},
{
"symbol": "W",
"mode": "SINGLE",
"value": 0.5
},
{
"symbol": "L",
"mode": "CALCUL"
},
{
"symbol": "Cd",
"mode": "SINGLE",
"value": 0.6
}
]
}
],
"parameters": [
{
"symbol": "Pr",
"mode": "SINGLE",
"value": 0.0001
},
{
"symbol": "Q",
"mode": "SINGLE",
"value": 3.5
},
{
"symbol": "Z1",
"mode": "SINGLE",
"value": 102
},
{
"symbol": "Z2",
"mode": "SINGLE",
"value": 101.5
}
]
}
]
}
\ No newline at end of file
{"session":[{"uid":"YTEwZG","props":{"calcType":3,"nodeType":2},"meta":{"title":"R. uniforme"},"children":[{"uid":"NDcxN3","props":{"calcType":14,"nodeType":2},"children":[],"parameters":[{"symbol":"Pr","mode":"SINGLE","value":0.0001},{"symbol":"Ks","mode":"SINGLE","value":40},{"symbol":"Q","mode":"CALCUL"},{"symbol":"If","mode":"SINGLE","value":0.001},{"symbol":"YB","mode":"SINGLE","value":1},{"symbol":"Y","mode":"SINGLE","value":0.89},{"symbol":"LargeurBerge","mode":"SINGLE","value":2.5}]}],"parameters":[{"symbol":"Pr","mode":"SINGLE","value":0.0001}]}]}
\ No newline at end of file
import { CreateStructure, cSnCirc, cSnTrapez, LoiDebit, ParamsSectionCirc,
ParamsSectionTrapez, Session } from "../../src";
ParamsSectionTrapez, Session } from "../../src/index";
import { PabDimension, PabDimensionParams } from "../../src/pab/pab_dimension";
import { RegimeUniforme } from "../../src/regime_uniforme";
import { SectionParametree } from "../../src/section/section_parametree";
......
import { CreateStructure, cSnTrapez, LoiDebit, ParamsSectionTrapez, Session } from "../../src";
import { CreateStructure, cSnTrapez, LoiDebit, ParamsSectionTrapez, Session } from "../../src/index";
import { SectionParametree } from "../../src/section/section_parametree";
import { Dever, DeverParams } from "../../src/structure/dever";
......
......@@ -6,7 +6,7 @@
*/
// import { describe, expect, it } from "../mock_jasmine";
import { Session } from "../../src";
import { Session } from "../../src/index";
import { PabDimension, PabDimensionParams } from "../../src/pab/pab_dimension";
let nub1: PabDimension;
......
import { CreateStructure, cSnCirc, LinkedValue, LoiDebit, ParallelStructure, ParallelStructureParams,
ParamsSectionCirc, Session } from "../../src";
ParamsSectionCirc, Session } from "../../src/index";
import { RegimeUniforme } from "../../src/regime_uniforme";
import { RectangularStructureParams } from "../../src/structure/structure_cem88d";
......
// tslint:disable-next-line:max-line-length
import { CreateStructure, cSnCirc, LoiDebit, ParamsSectionCirc, Session } from "../../src";
import { CreateStructure, cSnCirc, LoiDebit, ParamsSectionCirc, Session } from "../../src/index";
import { RegimeUniforme } from "../../src/regime_uniforme";
import { Dever, DeverParams } from "../../src/structure/dever";
......
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