public void GetEditor_Override_ReturnsOverrideValue() { var baseEditor = new MockUITypeEditor(); var overrideEditor = new MockUITypeEditor(); var mockDescriptor = new MockPropertyDescriptor(); mockDescriptor.GetEditorResult = baseEditor; var dynamicDescriptor = new DynamicPropertyDescriptor(mockDescriptor); dynamicDescriptor.SetEditor(typeof(MockUITypeEditor), overrideEditor); dynamicDescriptor.GetEditor(typeof(MockUITypeEditor)).Should().Be(overrideEditor); }
public void GetEditor_Override_ReturnsOverrideValue() { MockUITypeEditor baseEditor = new MockUITypeEditor(); MockUITypeEditor overrideEditor = new MockUITypeEditor(); MockPropertyDescriptor mockDescriptor = new MockPropertyDescriptor(); mockDescriptor.GetEditorResult = baseEditor; DynamicPropertyDescriptor dynamicDescriptor = new DynamicPropertyDescriptor(mockDescriptor); dynamicDescriptor.SetEditor(typeof(MockUITypeEditor), overrideEditor); Assert.That(dynamicDescriptor.GetEditor(typeof(MockUITypeEditor)), Is.EqualTo(overrideEditor)); }