using Deltares.Geotechnics; using Deltares.Geotechnics.IO; using Deltares.Geotechnics.Mechanisms; using Deltares.Standard.Forms; using NUnit.Framework; namespace Deltares.DSoilModel.Forms.Tests { [TestFixture, RequiresSTA] class SpecificMechanismPointLocationControlTests : ControlTester { protected override IPropertyControl CreatePropertyControl() { return new SpecificMechanismPointLocationControl(); } [Test] public void ControlBindingsTest() { MechanismSupport.Mechanisms = new Mechanism[] {Mechanism.None, Mechanism.Piping, Mechanism.Stability }; var m = new SpecificMechanismPointLocation { XCoordinate = 1.1, Mechanism = Mechanism.None, SoilProfile2D = new SoilProfile2D { Name = "Profile2D_to_test" } }; PropertyControl.SelectedObject = m; TestLabelControlVisibleValue(PropertyControl, "XcoordinateLabel", true, "X coordinaat"); TestSpinEditVisibleEnabledValue(PropertyControl, "XcoordinateEdit", true, true, m, c => c.XCoordinate, 5.5); TestLabelControlVisibleValue(PropertyControl, "MechanismLabel", true, "Mechanisme"); TestComboBoxVisibleEnabledValue(PropertyControl, "MechanismEdit", true, true, m, c => c.Mechanism, Mechanism.Piping); TestLabelControlVisibleValue(PropertyControl, "SoilProfileLabel", true, "Grondprofiel 2D"); TestTextEditVisibleEnabledValue(PropertyControl, "SoilProfileEdit", true, false, m, c => c.SoilProfile2D); } [Test] public void TestSelectedObject() { var smpl = new SpecificMechanismPointLocation(); Assert.AreNotSame(smpl, PropertyControl.SelectedObject); PropertyControl.SelectedObject = smpl; Assert.AreSame(smpl, PropertyControl.SelectedObject); } [Test] public void TestIsVisible() { Assert.IsTrue(PropertyControl.IsVisible); } } }