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());
        }
Exemple #2
0
 public void Text_BoundsNotSupported()
 {
     var obj = new Text3D("BBBB", 16).Bounds();
 }
Exemple #3
0
        public void Text_PositionIsCentered()
        {
            var text = new Text3D("Bom chicka bow wow");

            Assert.AreEqual(new Vector3(), text.Position());
        }
        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);
        }