public void ThrowExceptionWhenCreatingOutsideOfTransaction() { var collector = new CollectorService(); var wallService = new WallCreatorService(collector); var line = Line.CreateBound(XYZ.Zero, XYZ.BasisY.Multiply(10)); Assert.Throws <ModificationOutsideTransactionException>(() => wallService.CreateWall(doc, line)); }
public void CreateWall() { var collector = new CollectorService(); var wallService = new WallCreatorService(collector); var line = Line.CreateBound(XYZ.Zero, XYZ.BasisX.Multiply(10)); Wall wall; using (Transaction t = new Transaction(this.doc, "Create Wall")) { t.Start(); wall = wallService.CreateWall(doc, line); t.Commit(); } Assert.NotNull(wall); }