/// <summary>
        /// ctor
        /// </summary>
        /// <param name="decorated"></param>
        /// <param name="objectCache"></param>
        public CachingTypePropertyProviderDecorator(ITypePropertyProvider decorated, IObjectCache objectCache)
        {
            this.decorated   = decorated;
            this.objectCache = objectCache;

            RegisterDefaultKeyProvider(objectCache);
        }
Esempio n. 2
0
        public CachingTypePropertyProviderDecoratorTests()
        {
            var objectCacheMock      = Substitute.For <IObjectCache>();
            var propertyProviderMock = Substitute.For <ITypePropertyProvider>();

            sut = new CachingTypePropertyProviderDecorator(propertyProviderMock, objectCacheMock);
        }
        private static ITypePropertyProvider CreateCachedPropertyProvider(ITypePropertyProvider propertyProvider)
        {
            IObjectCache propertyCache = new ConcurrentObjectCache();

            return(new CachingTypePropertyProviderDecorator(propertyProvider, propertyCache));
        }
 public TypePropertyProviderTests()
 {
     sut = new ReflectionTypePropertyProvider();
 }
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="typePropertyProvider"></param>
 /// <param name="propertyAccessorFactory"></param>
 public DefaultPropertyProvider(ITypePropertyProvider typePropertyProvider, IPropertyAccessorFactory propertyAccessorFactory)
 {
     this.typePropertyProvider    = typePropertyProvider;
     this.propertyAccessorFactory = propertyAccessorFactory;
 }