using Deltares.Geotechnics; using Deltares.Standard.Forms; using NUnit.Framework; namespace Deltares.DSoilModel.Forms.Tests { [TestFixture, RequiresSTA] public class BoringLookup2DControlTest : ControlTester { protected override IPropertyControl CreatePropertyControl() { return new BoringLookup2DControl(); } [Test] public void TestControlBindings() { var profile = new SoilProfile2D(); var lookup = new BoringLookup2D { Xlocal = 1.23, Zlocal = 0, SoilProfile2D = profile }; PropertyControl.SelectedObject = lookup; Assert.AreSame(lookup, PropertyControl.SelectedObject); Assert.IsTrue(PropertyControl.IsVisible); TestSpinEditVisibleEnabledValue(PropertyControl, "XEdit", true, true, lookup, x => x.Xlocal, 1.0); TestLabelControlVisibleValue(PropertyControl, "XLabel", true, "Lokale x [-]"); // unit should be [m], see issue MDNLIB-796 } [Test] public void TestSelectedObject() { var lookup = new BoringLookup2D { Boring = new Boring( )}; PropertyControl.SelectedObject = lookup; Assert.AreSame(lookup, PropertyControl.SelectedObject); var subcontrol = GetPrivateField(PropertyControl, "BoringControl"); Assert.NotNull(subcontrol); Assert.AreSame(lookup.Boring, subcontrol.SelectedObject); } [Test] public void TestIsVisible() { Assert.IsTrue(PropertyControl.IsVisible); } } }