public void ByName_ValidArgs() { var ceilingTypeName = "Generic - 4\""; var ceilingType = CeilingType.ByName(ceilingTypeName); Assert.NotNull(ceilingType); Assert.AreEqual(ceilingTypeName, ceilingType.Name); }
public void ByOutlineTypeAndLevel_CurveArrayCeilingTypeLevel_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 ceilingType = CeilingType.ByName("Generic"); Assert.Throws(typeof(ArgumentNullException), () => Ceiling.ByOutlineTypeAndLevel(outline, null, level)); Assert.Throws(typeof(ArgumentNullException), () => Ceiling.ByOutlineTypeAndLevel(outline, ceilingType, null)); }
public void ByOutlineTypeAndLevel_CurveArrayCeilingTypeLevel_ProducesCeilingWithCorrectArea() { 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 ceilingType = CeilingType.ByName("Generic"); var ceiling = Ceiling.ByOutlineTypeAndLevel(outline, ceilingType, level); BoundingBoxVolume(ceiling.BoundingBox).ShouldBeApproximately(100 * 100, 1e-3); }
public void ByName_NullArgument() { Assert.Throws(typeof(ArgumentNullException), () => CeilingType.ByName(null)); }