/// <summary> /// Get properties. /// </summary> public static IReflectionProperties GetPropertiesDict(Type type) { var dict = new ReflectionProperties(); return(type?.GetRuntimeProperties()?.Aggregate(dict, (d, p) => { d[p.Name] = new ReflectionProperty(p); return d; })); }
/// <summary> /// Get properties having a custom attribute. /// </summary> public static IReflectionProperties <TAttr> GetPropertiesDict <TAttr>(Type type) where TAttr : class { var dict = new ReflectionProperties <TAttr>(); return(type?.GetRuntimeProperties()?.Aggregate(dict, (d, p) => { TAttr attr = null; if (typeof(TAttr) == typeof(object) || (attr = TryGetAttribute <TAttr>(p)) != null) { d[p.Name] = new ReflectionProperty <TAttr>(p, attr); } return d; })); }
protected override void BeforeTest(Commons.Spec.ExecutionModel.TestUnit test) { Value = new PValues(); Subject = new ReflectionProperties(Value); }