Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,69 @@ | ||
import { SecBuildH } from "./build-h"; | ||
import { SecPropertyType } from "../constant"; | ||
|
||
const H = new SecBuildH(); | ||
H.a = 1.2; | ||
H.b = 0.4; | ||
H.t1 = 0.019; | ||
H.t2 = 0.025; | ||
|
||
test("SecBuildH.setDimensions", () => { | ||
const secBuildH = new SecBuildH(); | ||
secBuildH.setDimensions(H.a, H.b, H.t1, H.t2); | ||
expect(secBuildH.a).toBe(H.a); | ||
expect(secBuildH.b).toBe(H.b); | ||
expect(secBuildH.t1).toBe(H.t1); | ||
expect(secBuildH.t2).toBe(H.t2); | ||
expect(secBuildH.name).toBe("BH-1200x400x19x25"); | ||
}); | ||
|
||
test("ビルドHのA", () => { | ||
const H = 1.2; | ||
const B = 0.4; | ||
const T1 = 0.019; | ||
const T2 = 0.025; | ||
const A = 4.185e-2; | ||
expect(SecBuildH.area(H, B, T1, T2)).toBe(A); | ||
expect(SecBuildH.property(SecPropertyType.Area, H, B, T1, T2)).toBe(A); | ||
expect(SecBuildH.area(H.a, H.b, H.t1, H.t2)).toBe(A); | ||
expect(SecBuildH.property(SecPropertyType.Area, H.a, H.b, H.t1, H.t2)).toBe( | ||
A | ||
); | ||
}); | ||
|
||
test("ビルドHの単位質量", () => { | ||
const H = 1.2; | ||
const B = 0.4; | ||
const T1 = 0.019; | ||
const T2 = 0.025; | ||
const M = 328.5225; | ||
expect(SecBuildH.property(SecPropertyType.MassPerMetre, H, B, T1, T2)).toBe( | ||
M | ||
); | ||
expect( | ||
SecBuildH.property(SecPropertyType.MassPerMetre, H.a, H.b, H.t1, H.t2) | ||
).toBe(M); | ||
}); | ||
|
||
test("ビルドHのIy", () => { | ||
const H = 1.2; | ||
const B = 0.4; | ||
const T1 = 0.019; | ||
const T2 = 0.025; | ||
const IY = 9.31221875e-3; | ||
const NUM_DIGITS = 17; | ||
expect(SecBuildH.secondMomentOfAreaY(H, B, T1, T2)).toBeCloseTo( | ||
expect(SecBuildH.secondMomentOfAreaY(H.a, H.b, H.t1, H.t2)).toBeCloseTo( | ||
IY, | ||
NUM_DIGITS | ||
); | ||
expect( | ||
SecBuildH.property(SecPropertyType.SecondMomentOfAreaY, H, B, T1, T2) | ||
SecBuildH.property( | ||
SecPropertyType.SecondMomentOfAreaY, | ||
H.a, | ||
H.b, | ||
H.t1, | ||
H.t2 | ||
) | ||
).toBeCloseTo(IY, NUM_DIGITS); | ||
}); | ||
|
||
test("ビルドHのIz", () => { | ||
const H = 1.2; | ||
const B = 0.4; | ||
const T1 = 0.019; | ||
const T2 = 0.025; | ||
const IZ = 2.673239875e-4; | ||
const NUM_DIGITS = 18; | ||
expect(SecBuildH.secondMomentOfAreaZ(H, B, T1, T2)).toBeCloseTo( | ||
expect(SecBuildH.secondMomentOfAreaZ(H.a, H.b, H.t1, H.t2)).toBeCloseTo( | ||
IZ, | ||
NUM_DIGITS | ||
); | ||
expect( | ||
SecBuildH.property(SecPropertyType.SecondMomentOfAreaZ, H, B, T1, T2) | ||
SecBuildH.property( | ||
SecPropertyType.SecondMomentOfAreaZ, | ||
H.a, | ||
H.b, | ||
H.t1, | ||
H.t2 | ||
) | ||
).toBeCloseTo(IZ, NUM_DIGITS); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters