Esempio n. 1
0
        public void SetUp()
        {
            var fresh = new CreateFreshDatabase();
            var configurationBuilder = new Autofac.ContainerBuilder();

            fresh.Create(configurationBuilder);
            var resolver = configurationBuilder.Build();

            _serialiser = resolver.Resolve<IDocumentStore>().Conventions.CreateSerializer();
            _databaseHandle = fresh;
        }
Esempio n. 2
0
        public void CanCreateDb()
        {
            using ( var fresh = new CreateFreshDatabase() )
            {
                var configurationBuilder = new Autofac.ContainerBuilder();

                fresh.Create(configurationBuilder);
                using ( var resolver = configurationBuilder.Build() )
                {
                    var dbA = resolver.Resolve<IDocumentStore>();
                    var dbB = resolver.Resolve<IDocumentStore>();

                    Assert.That(dbA, Is.SameAs(dbB));
                }
            }
        }
Esempio n. 3
0
        public void CanCreateNestedStructure()
        {
            using ( var fresh = new CreateFreshDatabase() )
            {
                var configurationBuilder = new Autofac.ContainerBuilder();
                fresh.Create(configurationBuilder);

                using ( var resolver = configurationBuilder.Build() )
                {
                    var dbA = resolver.Resolve<IDocumentStore>();
                    using (var session = dbA.OpenSession())
                    {
                        session.Store(new A() {Name = "Bob"});
                    }
                }
            }
        }