Beispiel #1
0
        public void OSCADObject_ClonesContainChildren()
        {
            var text = new Text3D("Hi").Rotate(90, 0, 0);

            var clone = text.Clone();

            //Clone has a child, and it should be the same thing
            Assert.IsTrue(clone.Children().Count() == 1);
            Assert.IsTrue(clone.Children().FirstOrDefault().GetType() == text.Children().FirstOrDefault().GetType());

            //But the child should be a different instance
            Assert.IsFalse(clone.Children().FirstOrDefault() == text.Children().FirstOrDefault());
        }
Beispiel #2
0
 public void Text_BoundsNotSupported()
 {
     var obj = new Text3D("BBBB", 16).Bounds();
 }
Beispiel #3
0
        public void Text_PositionIsCentered()
        {
            var text = new Text3D("Bom chicka bow wow");

            Assert.AreEqual(new Vector3(), text.Position());
        }
Beispiel #4
0
        public void OSCADObject_ChildrenWithRecursiveFalseReturnsOnlyDirectChildren()
        {
            var firstLevel = new Sphere().Union(new Cube(), new Sphere(), new Cylinder());
            firstLevel.Name = "Union";
            var secondLevel = new Text3D() { Name = "Text" }.Difference(firstLevel);

            var children = secondLevel.Children(false).ToList();

            Assert.AreEqual("Text", children[0].Name);
            Assert.AreEqual("Union", children[1].Name);
        }