Exemplo n.º 1
0
 public QueryStringCreator(Type value)
 {
     _typeInfo = CreateQueryParams(value);
     _getters  = value
                 .GetTypeInfo()
                 .GetProperties()
                 .ToDictionary(x => x.Name, x => DelegateFactory.CreatePropertyGetter(x));
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void CreatePropertyGetter_Null_ThrowException()
 {
     Assert.Throws(typeof(ArgumentNullException), () => DelegateFactory.CreatePropertyGetter(null));
 }