Index: src/Deltares.DSoilModel.Forms.Tests/SoilProfile1DLookup2DControlTest.cs =================================================================== diff -u -r322 -r325 --- src/Deltares.DSoilModel.Forms.Tests/SoilProfile1DLookup2DControlTest.cs (.../SoilProfile1DLookup2DControlTest.cs) (revision 322) +++ src/Deltares.DSoilModel.Forms.Tests/SoilProfile1DLookup2DControlTest.cs (.../SoilProfile1DLookup2DControlTest.cs) (revision 325) @@ -6,6 +6,21 @@ [TestFixture, RequiresSTA] public class SoilProfile1DLookup2DControlTest : ControlTester { + private SoilProfile1DLookup2DControl control; + + [SetUp] + public void Setup() + { + control = new SoilProfile1DLookup2DControl(); + } + + [TearDown] + public void TearDown() + { + control.Dispose(); + control = null; + } + [Test] public void TestControlBindings() { @@ -23,12 +38,27 @@ Assert.AreSame(lookup, control.SelectedObject); - Assert.IsTrue(control.IsVisible); - TestSpinEditVisibleEnabledValue(control, "XEdit", true, true, lookup, x => x.Xlocal, 1.0); TestLabelControlVisibleValue(control, "XLabel", true, "Lokale x [-]"); // unit should be [m], see issue MDNLIB-796 }; } + [Test] + public void TestSelectedObject() + { + var lookup = new SoilProfile1DLookup2D() { SoilProfile1D = new SoilProfile1D() }; + control.SelectedObject = lookup; + Assert.AreSame(lookup, control.SelectedObject); + var subcontrol = GetPrivateField(control, "sosSoilProfile1DControl1") as SosSoilProfile1DControl; + Assert.NotNull(subcontrol); + Assert.AreSame(lookup.SoilProfile1D, subcontrol.SelectedObject); + } + + [Test] + public void TestIsVisible() + { + Assert.IsTrue(control.IsVisible); + } + } }