Example #1
0
        public void BoxMetaToolWithMousePointsTransformationTest()
        {
            ShapeBuildHelper.BuildMetaActionTestBox(Setup);

            // Test that a new node was added
            Assert.AreEqual(2, Setup.Document.Root.Children.Count);

            // Check transformations and coordinates of the node
            var nodeBuilder = new NodeBuilder(Setup.Document.Root.Children[1]);

            Assert.AreEqual(
                SetupUtils.CheckNodeTranslationAgainst(nodeBuilder.Node, new Point3D(_testedFirstPoint.Location)),
                true, "Invalid transform interpreter on Node");
            Assert.AreEqual(
                nodeBuilder[0].TransformedAxis3D.Location.IsEqual(_testedFirstPoint.Location,
                                                                  Precision.Confusion), true,
                "Invalid first point coordinate");
        }
        public void CylinderMetaToolWithMousePointsTransformationTest()
        {
            ShapeBuildHelper.BuildMetaActionTestCylinder(Setup);

            Assert.AreEqual(2, Setup.Document.Root.Children.Count);

            var nodeBuilder  = new NodeBuilder(Setup.Document.Root.Children[1]);
            var axisLocation = nodeBuilder[0].TransformedAxis3D.Location;

            Assert.AreEqual(SetupUtils.CheckNodeTranslationAgainst(nodeBuilder.Node, new Point3D(axisLocation)), true,
                            "Invalid transform interpreter on Node");
            Assert.AreEqual(nodeBuilder[0].TransformedAxis3D.Location.IsEqual(axisLocation, Precision.Confusion),
                            true, "Invalid first point coordinate");

            var radiusFromDependency = nodeBuilder[1].Real;

            Assert.AreEqual(radiusFromDependency, TestedRadius, "Invalid final radius");

            var height = nodeBuilder[2].Real;

            Assert.AreEqual(height, TestedHeight, "Invalid height");
        }
Example #3
0
        public void TorusMetaToolWithMousePointsTransformationTest()
        {
            ShapeBuildHelper.BuildMetaActionTestTorus(Setup);

            Assert.AreEqual(1, Setup.Document.Root.Children.Count);

            var nodeBuilder = new NodeBuilder(Setup.Document.Root.Children[0]);

            Assert.AreEqual(
                SetupUtils.CheckNodeTranslationAgainst(Setup.Document.Root.Children[0], new Point3D(100, 100, 100)),
                true, "Invalid transform interpreter on Node");
            Assert.AreEqual(
                nodeBuilder[0].TransformedAxis3D.Location.IsEqual(new Point3D(100, 100, 100).GpPnt,
                                                                  Precision.Confusion), true,
                "Invalid first point coordinate");
            var internalRadiusFromDependency = nodeBuilder[1].Real;

            Assert.AreEqual(internalRadiusFromDependency, TestedInternalRadius, "Invalid internal radius");
            var externalRadiusFromDependency = nodeBuilder[2].Real;

            Assert.AreEqual(externalRadiusFromDependency, TestedExternalRadius, "Invalid external radius");
        }