public void CreatePropertySetter_Dummy_Ok() { PropertySetter setter = DelegateFactory.CreatePropertySetter(typeof(Dummy).GetProperty("Id")); var dummy = new Dummy(); setter(dummy, "1"); Assert.Equal(dummy.Id, 1); }
public ObjectCreator(Type type) { _objectActivator = DelegateFactory.CreateCtor(type); _setters = type .GetTypeInfo() .GetProperties() .ToDictionary(x => x.Name, x => DelegateFactory.CreatePropertySetter(x), StringComparer.OrdinalIgnoreCase); }
public void CreatePropertySetter_Null_ThrowException() { Assert.Throws(typeof(ArgumentNullException), () => DelegateFactory.CreatePropertySetter(null)); }