public void ByName_ValidArgs() { var floorTypeName = "Generic - 12\""; var floorType = FloorType.ByName(floorTypeName); Assert.NotNull(floorType); Assert.AreEqual(floorTypeName, floorType.Name); }
public void FloorSlabShapePoints_Edit() { var elevation = 100; var level = Level.ByElevation(elevation); var outline = new[] { Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(100, 0, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 0, 0), Point.ByCoordinates(100, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 100, 0), Point.ByCoordinates(0, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(0, 100, 0), Point.ByCoordinates(0, 0, 0)) }; var floorType = FloorType.ByName("Generic - 12\""); var floor = Floor.ByOutlineTypeAndLevel(outline, floorType, level); Assert.NotNull(floor); floor.AddPoint(Point.ByCoordinates(50, 50, 0)); Assert.IsTrue(floor.Points.ToList().Count == 5); double elev = floor.Points.First().Z; floor.MovePoint(floor.Points.First(), 10); floor.Points.First().Z.ShouldBeApproximately(elev + 10); }
public void ByOutlineTypeAndLevel_CurveArrayFloorTypeLevel_ThrowsExceptionWithNullArgument() { var elevation = 100; var level = Level.ByElevation(elevation); var outline = new[] { Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(100, 0, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 0, 0), Point.ByCoordinates(100, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 100, 0), Point.ByCoordinates(0, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(0, 100, 0), Point.ByCoordinates(0, 0, 0)) }; var floorType = FloorType.ByName("Generic - 12\""); Assert.Throws(typeof(ArgumentNullException), () => Floor.ByOutlineTypeAndLevel(outline, null, level)); Assert.Throws(typeof(ArgumentNullException), () => Floor.ByOutlineTypeAndLevel(outline, floorType, null)); }
public void ByOutlineTypeAndLevel_ValidArgs() { var elevation = 100; var level = Level.ByElevation(elevation); var outline = new[] { Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(100, 0, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 0, 0), Point.ByCoordinates(100, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 100, 0), Point.ByCoordinates(0, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(0, 100, 0), Point.ByCoordinates(0, 0, 0)) }; var floorType = FloorType.ByName("Generic - 12\""); var floor = Floor.ByOutlineTypeAndLevel(outline, floorType, level); Assert.NotNull(floor); }
public void ByOutlineTypeAndLevel_CurveArrayFloorTypeLevel_ProducesFloorWithCorrectArea() { var elevation = 100; var level = Level.ByElevation(elevation); var outline = new[] { Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(100, 0, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 0, 0), Point.ByCoordinates(100, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 100, 0), Point.ByCoordinates(0, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(0, 100, 0), Point.ByCoordinates(0, 0, 0)) }; var floorType = FloorType.ByName("Generic - 12\""); var floor = Floor.ByOutlineTypeAndLevel(outline, floorType, level); BoundingBoxVolume(floor.BoundingBox).ShouldBeApproximately(100 * 100 * 0.3048, 1e-3); }
public void CreateFoundationSlab_ByOutlineTypeAndLevel_CurveArrayFloorTypeLevel() { var elevation = 100; var level = Level.ByElevation(elevation); var outline = new[] { Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(100, 0, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 0, 0), Point.ByCoordinates(100, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(100, 100, 0), Point.ByCoordinates(0, 100, 0)), Line.ByStartPointEndPoint(Point.ByCoordinates(0, 100, 0), Point.ByCoordinates(0, 0, 0)) }; var floorType = FloorType.ByName("6\" Foundation Slab"); var floor = Floor.ByOutlineTypeAndLevel(outline, floorType, level); Assert.NotNull(floor); Assert.IsTrue(floor.InternalFloor.FloorType.IsFoundationSlab); Assert.AreEqual(floor.InternalFloor.FloorType.Name, "6\" Foundation Slab"); }
public void ByName_NullArgument() { Assert.Throws(typeof(ArgumentNullException), () => FloorType.ByName(null)); }