更新测试代码

pull/662560/MERGE
ChenX 7 years ago
parent 8337aaf8be
commit c581b8f823

@ -3,14 +3,15 @@ import * as THREE from 'three';
import { BlockTableRecord } from '../../src/DatabaseServices/BlockTableRecord';
import { CADFactory } from '../../src/DatabaseServices/CADFactory';
import { CADFile } from '../../src/DatabaseServices/CADFile';
import { AllObjectData, CADObject } from '../../src/DatabaseServices/CADObject';
import { CommandHistoryRecord } from '../../src/DatabaseServices/CommandHistoryRecord';
import { CreateObjectData } from '../../src/DatabaseServices/CreateObjectData';
import { Database } from '../../src/DatabaseServices/Database';
import { Entity } from '../../src/DatabaseServices/Entity';
import { HistorycRecord } from '../../src/DatabaseServices/HistorycRecord';
import { Line } from '../../src/DatabaseServices/Line';
import { ObjectAllDataHistoryRecord } from '../../src/DatabaseServices/ObjectAllDataHistoryRecord';
import { RemoveObjectData } from '../../src/DatabaseServices/RemoveObjectData';
import { CADObject, AllObjectData } from '../../src/DatabaseServices/CADObject';
function CadObjectToString(obj: CADObject)
{
@ -124,7 +125,7 @@ test('xxx', () =>
db.hm.Redo(); //?
db.hm.StartCmd("");
db.ModelSpace.Remove(db.GetObjectId(1).Object);
db.ModelSpace.Remove(db.GetObjectId(1).Object as Entity);
db.hm.Undo(); //?
db.hm.Undo(); //?
@ -158,8 +159,6 @@ test('xxx', () =>
expect(f3.ToString()).toBe(f.ToString());//对象序列化反序列化后 数据应该一样
});
test('创建 修改 撤销撤销 重做重做 撤销 重做', () =>
{
let db = new Database();
@ -184,4 +183,3 @@ test('创建 修改 撤销撤销 重做重做 撤销 重做', () =>
expect(CadObjectToString(db.hm)).toMatchSnapshot();
});

@ -1,6 +1,7 @@
import { Line } from "../../src/DatabaseServices/Line";
import { Vector3 } from "three";
import { IntersectLineAndLine, Intersect } from "../../src/GraphicsSystem/IntersectWith"
import { Vector3 } from 'three';
import { Line } from '../../src/DatabaseServices/Line';
import { IntersectLineAndLine, IntersectOption } from '../../src/GraphicsSystem/IntersectWith';
@ -11,16 +12,16 @@ test('直线相交,共线', () =>
let l2 = new Line(new Vector3(10, 0, 0), new Vector3(15, 0, 0));
let pts = IntersectLineAndLine(l1, l2, Intersect.ExtendThis);
let pts = IntersectLineAndLine(l1, l2, IntersectOption.ExtendThis);
expect(pts.length).toBe(0);
pts = IntersectLineAndLine(l1, l2, Intersect.OnBothOperands);
pts = IntersectLineAndLine(l1, l2, IntersectOption.OnBothOperands);
expect(pts.length).toBe(0);
pts = IntersectLineAndLine(l1, l2, Intersect.ExtendArg);
pts = IntersectLineAndLine(l1, l2, IntersectOption.ExtendArg);
expect(pts.length).toBe(1);
pts = IntersectLineAndLine(l1, l2, Intersect.ExtendBoth);
pts = IntersectLineAndLine(l1, l2, IntersectOption.ExtendBoth);
expect(pts.length).toBe(1);
});
@ -31,15 +32,15 @@ test('直线相交', () =>
let l2 = new Line(new Vector3(5, 0, 0), new Vector3(0, 5, 0));
let pts = IntersectLineAndLine(l1, l2, Intersect.ExtendThis);
let pts = IntersectLineAndLine(l1, l2, IntersectOption.ExtendThis);
expect(pts.length).toBe(1);
pts = IntersectLineAndLine(l1, l2, Intersect.OnBothOperands);
pts = IntersectLineAndLine(l1, l2, IntersectOption.OnBothOperands);
expect(pts.length).toBe(1);
pts = IntersectLineAndLine(l1, l2, Intersect.ExtendArg);
pts = IntersectLineAndLine(l1, l2, IntersectOption.ExtendArg);
expect(pts.length).toBe(1);
pts = IntersectLineAndLine(l1, l2, Intersect.ExtendBoth);
pts = IntersectLineAndLine(l1, l2, IntersectOption.ExtendBoth);
expect(pts.length).toBe(1);
});

Loading…
Cancel
Save