/// <summary>
        /// Change the default RavenDb datastore to the configured settings
        /// </summary>
        /// <param name="container"></param>
        /// <param name="settings"></param>
        public static void ReplaceDatastore(this IContainer container, RavenDbSettings settings)
        {
            container.Model.For<IDocumentStore>().Default.EjectObject();
            container.Model.For<RavenDbSettings>().EjectAndRemoveAll();

            container.Inject(settings);
        }
        public void build_in_memory()
        {
            var settings = new RavenDbSettings
            {
                RunInMemory = true
            };

            settings.Create().ShouldBeOfType<EmbeddableDocumentStore>()
                .RunInMemory.ShouldBeTrue();
        }
示例#3
0
        public void Start()
        {
            NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);

            RavenDbSettings settings = RavenDbSettings.InMemory();

            settings.UseEmbeddedHttpServer = true;

            _store = settings.Create();
            _store.Initialize();
        }
 public HarnessRegistry()
 {
     var dbSettings = new RavenDbSettings
     {
         RunInMemory = true,
         UseEmbeddedHttpServer = true
     };
     Services(x =>
     {
         x.AddService(dbSettings);
         x.AddService<IDocumentStoreConfigurationAction, SimpleEmbeddedRavenDbPortConfigurationAction>();
     });
 }
        public void simple_construction()
        {
            var settings = new RavenDbSettings
            {
                RunInMemory = true
            };

            var actions = new IDocumentStoreConfigurationAction[]
            {new CustomizeRavenJsonSerializer(new JsonConverter[0]),};

            var builder = new DocumentStoreBuilder(settings, actions);
            var store = builder.Build().ShouldBeOfType<EmbeddableDocumentStore>();
            store.RunInMemory.ShouldBeTrue();
            store.Conventions.CustomizeJsonSerializer.ShouldNotBeNull();
        }
 public DocumentStoreBuilder(RavenDbSettings settings, IEnumerable <IDocumentStoreConfigurationAction> configurations)
 {
     _settings       = settings;
     _configurations = configurations;
 }
 /// <summary>
 /// Change the default RavenDb datastore to the configured settings
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="settings"></param>
 public static void ReplaceDatastore(this IServiceFactory factory, RavenDbSettings settings)
 {
     factory.Get<IContainer>().ReplaceDatastore(settings);
 }
示例#8
0
 public DocumentStoreBuilder(RavenDbSettings settings, IEnumerable<IDocumentStoreConfigurationAction> configurations)
 {
     _settings = settings;
     _configurations = configurations;
 }