开发:增加测试用例

pull/2157/MERGE
ChenX 1 year ago
parent f2788ddc05
commit 87060186ce

File diff suppressed because it is too large Load Diff

@ -4,13 +4,15 @@ import { DrawUprightWineRackTool } from "../../src/Add-on/DrawWineRack/DrawUprig
import { Board } from "../../src/DatabaseServices/Entity/Board";
import { Box3Ext } from "../../src/Geometry/Box";
import { ISpaceParse } from "../../src/Geometry/SpaceParse/ISpaceParse";
import { EFullDir, EFullType, EWineRackType, EWRackArrayType, IWineRackOption } from "../../src/UI/Store/WineRackInterface";
import { EFullDir, EFullType, EWineRackStyle, EWineRackType, EWRackArrayType, IWineRackOption } from "../../src/UI/Store/WineRackInterface";
import "../Utils/jest.util";
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
const UprightTool = DrawUprightWineRackTool.GetInstance() as DrawUprightWineRackTool;
const ObliqueTool = DrawObliqueWineRackTool.GetInstance() as DrawObliqueWineRackTool;
const option: IWineRackOption = {
type: EWineRackType.Oblique,
wineRackStyle: EWineRackStyle.WholeLattice,
arrayType: EWRackArrayType.ByWidth,
fullType: EFullType.ByWidth,
isFull: false,
@ -54,6 +56,48 @@ describe("酒格功能测试", () =>
UprightTool.Parse(spaceParse, option);
ObliqueTool.Parse(spaceParse, option);
expect(UprightTool.boardlist.length).toMatchSnapshot();
for (let br of UprightTool.boardlist)
{
expect(br.Position.x).toMatchNumberSnapshot(3);
expect(br.Position.y).toMatchNumberSnapshot(3);
expect(br.Position.z).toMatchNumberSnapshot(3);
expect(br.Height).toMatchNumberSnapshot(3);
expect(br.Width).toMatchNumberSnapshot(3);
}
expect(ObliqueTool.boardlist.length).toMatchSnapshot();
for (let br of ObliqueTool.boardlist)
{
expect(br.Position.x).toMatchNumberSnapshot(3);
expect(br.Position.y).toMatchNumberSnapshot(3);
expect(br.Position.z).toMatchNumberSnapshot(3);
expect(br.Height).toMatchNumberSnapshot(3);
expect(br.Width).toMatchNumberSnapshot(3);
}
option.wineRackStyle = EWineRackStyle.WholeLattice;
UprightTool.Parse(spaceParse, option);
ObliqueTool.Parse(spaceParse, option);
expect(UprightTool.boardlist.length).toMatchSnapshot();
for (let br of UprightTool.boardlist)
{
expect(br.Position.x).toMatchNumberSnapshot(3);
expect(br.Position.y).toMatchNumberSnapshot(3);
expect(br.Position.z).toMatchNumberSnapshot(3);
expect(br.Height).toMatchNumberSnapshot(3);
expect(br.Width).toMatchNumberSnapshot(3);
}
expect(ObliqueTool.boardlist.length).toMatchSnapshot();
for (let br of ObliqueTool.boardlist)
{
expect(br.Position.x).toMatchNumberSnapshot(3);
expect(br.Position.y).toMatchNumberSnapshot(3);
expect(br.Position.z).toMatchNumberSnapshot(3);
expect(br.Height).toMatchNumberSnapshot(3);
expect(br.Width).toMatchNumberSnapshot(3);
}
});
});

Loading…
Cancel
Save