Index: src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj =================================================================== diff -u -r345 -r353 --- src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj (.../Deltares.DSoilModel.Forms.Tests.csproj) (revision 345) +++ src/Deltares.DSoilModel.Forms.Tests/Deltares.DSoilModel.Forms.Tests.csproj (.../Deltares.DSoilModel.Forms.Tests.csproj) (revision 353) @@ -110,6 +110,7 @@ + Index: src/Deltares.DSoilModel.Forms.Tests/SpecificMechanismPointLocationControlTests.cs =================================================================== diff -u --- src/Deltares.DSoilModel.Forms.Tests/SpecificMechanismPointLocationControlTests.cs (revision 0) +++ src/Deltares.DSoilModel.Forms.Tests/SpecificMechanismPointLocationControlTests.cs (revision 353) @@ -0,0 +1,54 @@ +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() + { + var m = new SpecificMechanismPointLocation + { + XCoordinate = 1.1, + Mechanism = Mechanism.AsphaltRevetment, + 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.Dunes); + + TestLabelControlVisibleValue(PropertyControl, "SoilProfileLabel", true, "Grondprofiel 2D"); + TestTextEditVisibleEnabledValue(PropertyControl, "SoilProfileEdit", true, false, m, c => c.SoilProfile2D, new 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); + } + } +}