public DynamicObjectConverter(IObjectConverterCache cache) { _cache = cache; _propertyCache = new ReadWritePropertyCache <TImplementation>(); _converters = _propertyCache .Select(property => GetDictionaryToObjectConverter(property, property.Property.PropertyType)) .ToArray(); }
public void Should_cache_properties_nicely() { var cache = new ReadWritePropertyCache<PrivateSetter>(true); var instance = new PrivateSetter(); const string expectedValue = "Chris"; cache["Name"].Set(instance, expectedValue); Assert.AreEqual(expectedValue, instance.Name); }
public void Should_cache_properties_nicely() { var cache = new ReadWritePropertyCache <PrivateSetter>(true); var instance = new PrivateSetter(); const string expectedValue = "Chris"; cache["Name"].Set(instance, expectedValue); Assert.AreEqual(expectedValue, instance.Name); }