public QueryStringCreator(Type value) { _typeInfo = CreateQueryParams(value); _getters = value .GetTypeInfo() .GetProperties() .ToDictionary(x => x.Name, x => DelegateFactory.CreatePropertyGetter(x)); }
public void CreatePropertyGetter_Dummy_Ok() { PropertyGetter getter = DelegateFactory.CreatePropertyGetter(typeof(Dummy).GetProperty("Id")); var dummy = new Dummy { Id = 1 }; object actual = getter(dummy); Assert.Equal(dummy.Id, actual); }
public void CreatePropertyGetter_Null_ThrowException() { Assert.Throws(typeof(ArgumentNullException), () => DelegateFactory.CreatePropertyGetter(null)); }