Beispiel #1
0
 public void ByName_ValidArgs()
 {
     var floorTypeName = "Generic - 12\"";
     var floorType = FloorType.ByName(floorTypeName);
     Assert.NotNull(floorType);
     Assert.AreEqual(floorTypeName, floorType.Name);
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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");
        }
Beispiel #7
0
 public void ByName_NullArgument()
 {
     Assert.Throws(typeof(ArgumentNullException), () => FloorType.ByName(null));
 }