예제 #1
0
        public static void Setup(out IDefinitionManager definitions, out ContentActivator activator, out IItemNotifier notifier, out FakeSessionProvider sessionProvider, out ItemFinder finder, out SchemaExport schemaCreator, out InterceptingProxyFactory proxyFactory, IWebContext context, DatabaseSection config, ConfigurationBuilderParticipator[] participators, params Type[] itemTypes)
        {
            Setup(out definitions, out activator, out notifier, out proxyFactory, itemTypes);

            var connectionStrings    = (ConnectionStringsSection)ConfigurationManager.GetSection("connectionStrings");
            var configurationBuilder = new ConfigurationBuilder(definitions, new ClassMappingGenerator(), new ThreadContext(), participators, config, connectionStrings);
            var configurationSource  = new ConfigurationSource(configurationBuilder);

            sessionProvider = new FakeSessionProvider(configurationSource, new NHInterceptor(proxyFactory, configurationSource, notifier), context);

            finder = new ItemFinder(sessionProvider, definitions);

            schemaCreator = new SchemaExport(configurationSource.BuildConfiguration());
        }