public void GetDataMappers()
        {
            // Assign
            IConfigFactory <ISitecoreQueryParameter> queryParameterFactory = new QueryParameterConfigFactory();
            IConfigFactory <AbstractDataMapper>      configFactory         = new DataMapperConfigFactory(queryParameterFactory);

            // Act
            var result = configFactory.GetItems();

            // Assert
            Assert.AreEqual(38, result.Count());
        }
        public void GetDataMappers()
        {
            // Assign
            IConfigFactory<ISitecoreQueryParameter> queryParameterFactory = new QueryParameterConfigFactory();
            IConfigFactory<AbstractDataMapper> configFactory = new DataMapperConfigFactory(queryParameterFactory);

            // Act
            var result = configFactory.GetItems();

            // Assert
            Assert.AreEqual(41, result.Count());
        }
예제 #3
0
 public DependencyResolver(Config config)
 {
     Config = config;
     CacheManager = () => new HttpCache();
     QueryParameterFactory = new QueryParameterConfigFactory();
     DataMapperResolverFactory = new DataMapperTaskConfigFactory();
     DataMapperFactory = new DataMapperConfigFactory(QueryParameterFactory);
     ConfigurationResolverFactory = new ConfigurationResolverConfigFactory();
     ObjectConstructionFactory = new ObjectConstructionTaskConfigFactory(this);
     ObjectSavingFactory = new ObjectSavingTaskConfigFactory();
     ConfigurationMapFactory = new ConfigurationMapConfigFactory();
 }
        public void GetDataMappers()
        {
            // Assign
            QueryParameterConfigFactory queryParameterFactory = new QueryParameterConfigFactory();
            DataMapperConfigFactory     configFactory         = new DataMapperConfigFactory(queryParameterFactory);

            configFactory.Finalise();
            queryParameterFactory.Finalise();

            // Act
            var result = configFactory.GetItems();

            // Assert
            Assert.AreEqual(42, result.Count());
        }
 public DependencyResolver(Config config)
 {
     Config = config;
     Log = new Log();
     CacheManager = () => new NetMemoryCacheManager();
     QueryParameterFactory = new QueryParameterConfigFactory();
     DataMapperResolverFactory = new DataMapperTaskConfigFactory();
     DataMapperFactory = new DataMapperConfigFactory(QueryParameterFactory);
     ConfigurationResolverFactory = new ConfigurationResolverConfigFactory();
     ObjectConstructionFactory = new ObjectConstructionTaskConfigFactory(this);
     ObjectSavingFactory = new ObjectSavingTaskConfigFactory();
     ConfigurationMapFactory = new ConfigurationMapConfigFactory();
     GlassHtmlFactory = new GlassHtmlFactory();
     ItemVersionHandler = new ItemVersionHandler(config);
 }
        public void GetDataMappers()
        {
            // Assign
            IDependencyResolver dependencyResolver = Substitute.For <IDependencyResolver>();
            IConfigFactory <ISitecoreQueryParameter> queryParameterFactory = new QueryParameterConfigFactory(null);

            dependencyResolver.QueryParameterFactory.Returns(queryParameterFactory);

            IConfigFactory <AbstractDataMapper> configFactory = new DataMapperConfigFactory(dependencyResolver);

            // Act
            var result = configFactory.GetItems();

            // Assert
            Assert.AreEqual(42, result.Count());
        }