public void GetPropertyType_checks_each() { var composite = PropertyProvider.Compose( PropertyProvider.FromValue(new { a = 1, b = 2.0 }), PropertyProvider.FromValue(new { c = "1", d = 2.0m }) ); Assert.Equal(typeof(string), composite.GetPropertyType("c")); }
public void TryGetProperty_checks_each() { var composite = PropertyProvider.Compose( PropertyProvider.FromValue(new { a = "1", b = "2" }), PropertyProvider.FromValue(new { c = "1", d = "2" }) ); object result; Assert.True(composite.TryGetProperty("c", out result)); Assert.Equal("1", result); }
public HxlTemplateContext(object owner) { _self = Properties.FromValue(this); _ownerValues = owner == null ? Properties.Null : Properties.FromValue(owner); _selfValues = PropertyProvider.Compose(_ownerValues, _self, DataProviders); }
public void Compose_will_apply_optimal_composite_on_nulls() { var original = new Properties(); Assert.Same(original, PropertyProvider.Compose(PropertyProvider.Null, original, PropertyProvider.Null)); }
public void Compose_converts_null_to_Null_provider() { Assert.Same(PropertyProvider.Null, PropertyProvider.Compose(null, null)); }