Index: src/Deltares.DSoilModel.Forms.Tests/BoringLookup2DControlTest.cs =================================================================== diff -u -r321 -r324 --- src/Deltares.DSoilModel.Forms.Tests/BoringLookup2DControlTest.cs (.../BoringLookup2DControlTest.cs) (revision 321) +++ src/Deltares.DSoilModel.Forms.Tests/BoringLookup2DControlTest.cs (.../BoringLookup2DControlTest.cs) (revision 324) @@ -6,27 +6,57 @@ [TestFixture, RequiresSTA] public class BoringLookup2DControlTest : ControlTester { + private BoringLookup2DControl control; + + [SetUp] + public void Setup() + { + control = new BoringLookup2DControl(); + } + + [TearDown] + public void TearDown() + { + control.Dispose(); + control = null; + } + [Test] public void TestControlBindings() { - using (var control = new BoringLookup2DControl()) + var profile = new SoilProfile2D(); + var lookup = new BoringLookup2D { - var profile = new SoilProfile2D(); - var lookup = new BoringLookup2D - { - Xlocal = 1.23, - Zlocal = 0, - SoilProfile2D = profile - }; - control.SelectedObject = lookup; + Xlocal = 1.23, + Zlocal = 0, + SoilProfile2D = profile + }; + control.SelectedObject = lookup; - Assert.AreSame(lookup, control.SelectedObject); + Assert.AreSame(lookup, control.SelectedObject); - Assert.IsTrue(control.IsVisible); + 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 - }; + 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 BoringLookup2D { Boring = new Boring( )}; + control.SelectedObject = lookup; + Assert.AreSame(lookup, control.SelectedObject); + + var subcontrol = GetPrivateField(control, "BoringControl") as BoringControl; + Assert.NotNull(subcontrol); + Assert.AreSame(lookup.Boring, subcontrol.SelectedObject); + } + + [Test] + public void TestIsVisible() + { + Assert.IsTrue(control.IsVisible); + } } }