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