public void PropertySetterCustomization() { var thing = new Thing(); var property = Thing.GetField1Property(); Assert.IsNull(thing.Field1); var customization = (IPropertyCustomization)property; var impl = new FakePropertyImpl(); impl.BaseImpl = customization.OverrideImpl(impl); property.SetValue(thing, "test"); Assert.AreEqual(">>test", thing.Field1); }
public void PropertyGetterCustomization() { var thing = new Thing(); var property = Thing.GetField1Property(); const string testValue = "test"; thing.Field1 = testValue; Assert.AreEqual(testValue, thing.Field1); var customization = (IPropertyCustomization)property; var impl = new FakePropertyImpl(); impl.BaseImpl = customization.OverrideImpl(impl); Assert.IsNotNull(impl.BaseImpl); Assert.AreEqual("<<" + testValue, property.GetValue(thing)); }
public void PropertySetterCustomization() { Thing thing = new Thing(); PropertyDescriptor property = Thing.GetField1Property(); Assert.IsNull(thing.Field1); IPropertyCustomization customization = (IPropertyCustomization) property; FakePropertyImpl impl = new FakePropertyImpl(); impl.BaseImpl = customization.OverrideImpl(impl); property.SetValue(thing, "test"); Assert.AreEqual(">>test", thing.Field1); }
public void PropertyGetterCustomization() { Thing thing = new Thing(); PropertyDescriptor property = Thing.GetField1Property(); const string testValue = "test"; thing.Field1 = testValue; Assert.AreEqual(testValue, thing.Field1); IPropertyCustomization customization = (IPropertyCustomization) property; FakePropertyImpl impl = new FakePropertyImpl(); impl.BaseImpl = customization.OverrideImpl(impl); Assert.IsNotNull(impl.BaseImpl); Assert.AreEqual("<<" + testValue, property.GetValue(thing)); }