Esempio n. 1
0
        public void ByName_ValidArgs()
        {
            var ceilingTypeName = "Generic - 4\"";
            var ceilingType     = CeilingType.ByName(ceilingTypeName);

            Assert.NotNull(ceilingType);
            Assert.AreEqual(ceilingTypeName, ceilingType.Name);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public void ByName_NullArgument()
 {
     Assert.Throws(typeof(ArgumentNullException), () => CeilingType.ByName(null));
 }