|
|
@ -4,13 +4,15 @@ import { DrawUprightWineRackTool } from "../../src/Add-on/DrawWineRack/DrawUprig
|
|
|
|
import { Board } from "../../src/DatabaseServices/Entity/Board";
|
|
|
|
import { Board } from "../../src/DatabaseServices/Entity/Board";
|
|
|
|
import { Box3Ext } from "../../src/Geometry/Box";
|
|
|
|
import { Box3Ext } from "../../src/Geometry/Box";
|
|
|
|
import { ISpaceParse } from "../../src/Geometry/SpaceParse/ISpaceParse";
|
|
|
|
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";
|
|
|
|
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
|
|
|
|
const UprightTool = DrawUprightWineRackTool.GetInstance() as DrawUprightWineRackTool;
|
|
|
|
const UprightTool = DrawUprightWineRackTool.GetInstance() as DrawUprightWineRackTool;
|
|
|
|
const ObliqueTool = DrawObliqueWineRackTool.GetInstance() as DrawObliqueWineRackTool;
|
|
|
|
const ObliqueTool = DrawObliqueWineRackTool.GetInstance() as DrawObliqueWineRackTool;
|
|
|
|
|
|
|
|
|
|
|
|
const option: IWineRackOption = {
|
|
|
|
const option: IWineRackOption = {
|
|
|
|
type: EWineRackType.Oblique,
|
|
|
|
type: EWineRackType.Oblique,
|
|
|
|
|
|
|
|
wineRackStyle: EWineRackStyle.WholeLattice,
|
|
|
|
arrayType: EWRackArrayType.ByWidth,
|
|
|
|
arrayType: EWRackArrayType.ByWidth,
|
|
|
|
fullType: EFullType.ByWidth,
|
|
|
|
fullType: EFullType.ByWidth,
|
|
|
|
isFull: false,
|
|
|
|
isFull: false,
|
|
|
@ -54,6 +56,48 @@ describe("酒格功能测试", () =>
|
|
|
|
UprightTool.Parse(spaceParse, option);
|
|
|
|
UprightTool.Parse(spaceParse, option);
|
|
|
|
ObliqueTool.Parse(spaceParse, option);
|
|
|
|
ObliqueTool.Parse(spaceParse, option);
|
|
|
|
expect(UprightTool.boardlist.length).toMatchSnapshot();
|
|
|
|
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();
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|