private void runCutOneHoletest(Vector3 cutterPos, Vector3 cutterSca, TestHoleJson testHoleJson) { Init(); createCube(0, 0, 0); createCube(6, 0, 0); runCutHoleTest(cutterPos, cutterSca, testHoleJson); CleanUp(); }
private void runCutHoleTest(Vector3 cutterPos, Vector3 cutterSca, TestHoleJson testHoleJson, int expecteHoleCount = 2) { this.cutter.transform.position = cutterPos; this.cutter.transform.localScale = cutterSca; Debug.Log(string.Format("testing cutter with pos:{0} sca:{1}", cutterPos, cutterSca)); NodeDataManager.onAddNode += this.onAddNode; NodeHoleCutter.CutHoles(this.cutter); Assert.AreEqual(expecteHoleCount, this.nodesCreated.Count, string.Format("There are not {0} holes", expecteHoleCount)); foreach (var hole in this.nodesCreated) { Assert.AreEqual(NodeType.HOLE, hole.nodeType); testHoleJson(hole); } NodeDataManager.onAddNode -= this.onAddNode; }