コード例 #1
0
ファイル: ManagedIndex.cs プロジェクト: AndyHitchman/Stash
        public ManagedIndex(BerkeleyBackingStore backingStore, IBerkeleyBackingStoreEnvironment environment, IRegisteredIndexer registeredIndexer)
        {
            this.backingStore = backingStore;
            this.environment = environment;
            this.registeredIndexer = registeredIndexer;

            indexCompiled = new EventWaitHandle(false, EventResetMode.ManualReset);
        }
        protected override void Given()
        {
            var intBackingStore = new BerkeleyBackingStore(new DefaultBerkeleyBackingStoreEnvironment(TempDir));
            var registrar = new Registrar<BerkeleyBackingStore>(intBackingStore);
            registrar.PerformRegistration(
                context =>
                    {
                        context.Graph<GraphAffectedByNewIndex>();
                        context.Index(new ExistingIndex());
                    });
            registrar.ApplyRegistration();
            var intRegistry = registrar.Registry;
            var intSessFactory = new SessionFactory(intRegistry);

            using(var session = intSessFactory.GetSession())
            {
                session.Endure(new GraphAffectedByNewIndex { Text = "TheGraph"});
            }

            intBackingStore.Close();
        }
 protected override void When()
 {
     backingStore = new BerkeleyBackingStore(new DefaultBerkeleyBackingStoreEnvironment(TempDir));
     var registrar = new Registrar<BerkeleyBackingStore>(backingStore);
     registrar.PerformRegistration(
         context =>
         {
             context.Graph<GraphAffectedByNewIndex>();
             context.Index(new ExistingIndex());
             context.Index(new NewIndex());
         });
     registrar.ApplyRegistration();
     registry = registrar.Registry;
     sessionFactory = new SessionFactory(registry);
 }