Ejemplo n.º 1
0
        public void CreateBox()
        {
            Assume.That(_Viewport, Is.Not.Null);

            // Start tool
            MainWindow.Ribbon.SelectGroup("Model");
            MainWindow.Ribbon.ClickButton("CreateBox");
            Assert.That(MainWindow.Ribbon.IsButtonChecked("CreateBox"), Is.True);

            // Three point creation
            _Viewport.ClickRelative(0.3, 0.3);
            _Viewport.ClickRelative(0.6, 0.6);
            _Viewport.ClickRelative(0.6, 0.3);

            // Tool has finished
            Assert.That(MainWindow.Ribbon.IsButtonChecked("CreateBox"), Is.False);

            // Check property panel for correct creation
            _BodyPanel = MainWindow.PropertyView.FindPanelByClass("BodyPropertyPanel");
            Assert.That(_BodyPanel, Is.Not.Null);
            Assert.That(_BodyPanel.GetValue <string>("BodyName"), Is.EqualTo("Box_1"));

            _BoxPanel = MainWindow.PropertyView.FindPanelByClass("BoxPropertyPanel");
            Assert.That(_BoxPanel, Is.Not.Null);
            Assert.That(_BoxPanel.GetValue <double>("BoxLength"), Is.GreaterThan(0.35));
            Assert.That(_BoxPanel.GetValue <double>("BoxWidth"), Is.GreaterThan(5.0));
            Assert.That(_BoxPanel.GetValue <double>("BoxHeight"), Is.GreaterThan(3.0));
        }
Ejemplo n.º 2
0
        public void ChangeDimensions()
        {
            Assume.That(_BoxPanel, Is.Not.Null);
            Assume.That(_Viewport, Is.Not.Null);

            // Set new values
            _BoxPanel.EnterValue("BoxLength", 3.0);
            _BoxPanel.EnterValue("BoxWidth", 7.0);
            _BoxPanel.EnterValue("BoxHeight", 2.0);

            Assert.AreEqual(3.0, Pipe.GetValue <double>("$Selected.Shape.DimensionX"));
            Assert.AreEqual(7.0, Pipe.GetValue <double>("$Selected.Shape.DimensionY"));
            Assert.AreEqual(2.0, Pipe.GetValue <double>("$Selected.Shape.DimensionZ"));

            // Deselect
            _Viewport.ClickRelative(0.9, 0.5);
            Assume.That(MainWindow.PropertyView.FindPanelByClass("BoxPropertyPanel"), Is.Null);

            // Reselect
            _Viewport.ClickRelative(0.5, 0.5);
            _BoxPanel = MainWindow.PropertyView.FindPanelByClass("BoxPropertyPanel");
            Assert.That(_BoxPanel, Is.Not.Null);

            // Check Values
            Assert.That(_BoxPanel.GetValue <double>("BoxLength"), Is.EqualTo(3.0));
            Assert.That(_BoxPanel.GetValue <double>("BoxWidth"), Is.EqualTo(7.0));
            Assert.That(_BoxPanel.GetValue <double>("BoxHeight"), Is.EqualTo(2.0));
        }
Ejemplo n.º 3
0
        public void CreateCylinder()
        {
            Assume.That(_Viewport, Is.Not.Null);

            // Start tool
            MainWindow.Ribbon.SelectGroup("Model");
            MainWindow.Ribbon.ClickButton("CreateCylinder");
            Assert.That(MainWindow.Ribbon.IsButtonChecked("CreateCylinder"), Is.True);

            // Three point creation
            _Viewport.ClickRelative(0.5, 0.5);
            _Viewport.ClickRelative(0.5, 0.7);
            _Viewport.ClickRelative(0.5, 0.3);

            // Tool has finished
            Assert.That(MainWindow.Ribbon.IsButtonChecked("CreateCylinder"), Is.False);

            // Check property panel for correct creation
            _BodyPanel = MainWindow.PropertyView.FindPanelByClass("BodyPropertyPanel");
            Assert.That(_BodyPanel, Is.Not.Null);
            Assert.That(_BodyPanel.GetValue <string>("BodyName"), Is.EqualTo("Cylinder_1"));

            _CylinderPanel = MainWindow.PropertyView.FindPanelByClass("CylinderPropertyPanel");
            Assert.That(_CylinderPanel, Is.Not.Null);
            Assert.That(_CylinderPanel.GetValue <double>("CylinderRadius"), Is.GreaterThan(3.0));
            Assert.That(_CylinderPanel.GetValue <double>("CylinderHeight"), Is.GreaterThan(2.0));
            Assert.That(_CylinderPanel.GetValue <double>("CylinderSegment"), Is.EqualTo(360.0));
        }