Index: Core/Common/src/Core.Common.Gui/UITypeEditors/SelectionEditor.cs =================================================================== diff -u -r67284323e2785c651633d9c52049ba12a9c70e6a -r19c2e039d6f50c9acf13aaad062d481a3d6e8dd3 --- Core/Common/src/Core.Common.Gui/UITypeEditors/SelectionEditor.cs (.../SelectionEditor.cs) (revision 67284323e2785c651633d9c52049ba12a9c70e6a) +++ Core/Common/src/Core.Common.Gui/UITypeEditors/SelectionEditor.cs (.../SelectionEditor.cs) (revision 19c2e039d6f50c9acf13aaad062d481a3d6e8dd3) @@ -141,7 +141,7 @@ foreach (TProperty option in GetAvailableOptions(context)) { int index = listBox.Items.Add(option); - if (ReferenceEquals(GetCurrentOption(context), option)) + if (Equals(GetCurrentOption(context), option)) { listBox.SelectedIndex = index; } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/HydraulicBoundaryLocationEditorTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r19c2e039d6f50c9acf13aaad062d481a3d6e8dd3 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/HydraulicBoundaryLocationEditorTest.cs (.../HydraulicBoundaryLocationEditorTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/HydraulicBoundaryLocationEditorTest.cs (.../HydraulicBoundaryLocationEditorTest.cs) (revision 19c2e039d6f50c9acf13aaad062d481a3d6e8dd3) @@ -84,11 +84,13 @@ public void EditValue_WithCurrentItemInAvailableItems_ReturnsCurrentItem() { // Setup - SelectableHydraulicBoundaryLocation hydraulicBoundaryLocation = CreateSelectableHydraulicBoundaryLocation(); - var properties = new ObjectPropertiesWithSelectableHydraulicBoundaryLocation(hydraulicBoundaryLocation, new[] - { - hydraulicBoundaryLocation - }); + var selectedHydraulicBoundaryLocation = new HydraulicBoundaryLocation(23, "name", 0, 0); + var properties = new ObjectPropertiesWithSelectableHydraulicBoundaryLocation( + new SelectableHydraulicBoundaryLocation(selectedHydraulicBoundaryLocation, null), + new[] + { + new SelectableHydraulicBoundaryLocation(selectedHydraulicBoundaryLocation, null) + }); var propertyBag = new DynamicPropertyBag(properties); var editor = new HydraulicBoundaryLocationEditor(); var someValue = new object(); @@ -103,7 +105,8 @@ object result = editor.EditValue(descriptorContext, serviceProvider, someValue); // Assert - Assert.AreSame(hydraulicBoundaryLocation, result); + Assert.AreEqual(new SelectableHydraulicBoundaryLocation(selectedHydraulicBoundaryLocation, null), result); + mockRepository.VerifyAll(); }