protected BaseTest()
 {
     Store        = NewDocumentStore();
     RavenOptions = new RavenServiceOptions(Store);
     Factory      = new IdentityServerServiceFactory();
     Factory.ConfigureRavenSession(RavenOptions);
     session = new Lazy <IAsyncDocumentSession>(() => Store.OpenAsyncSession());
 }
 public static void ConfigureScope(this IdentityServerServiceFactory factory, RavenServiceOptions options)
 {
     options.Store.Conventions.RegisterIdConvention <Scope>(
         (dbname, commands, scope) => options.Store.Conventions.FindTypeTagName(typeof(Scope)) + "/" + scope.Name);
     factory.Register(new Registration <IScopeStore, ScopeStore>());
 }
 public static void ConfigureClient(this IdentityServerServiceFactory factory, RavenServiceOptions options)
 {
     options.Store.Conventions.RegisterIdConvention <Client>(
         (dbname, commands, client) => options.Store.Conventions.FindTypeTagName(typeof(Client)) + "/" + client.ClientId);
     factory.Register(new Registration <IClientStore, ClientStore>());
 }
 public static void ConfigureRavenSession(this IdentityServerServiceFactory factory, RavenServiceOptions options)
 {
     IndexCreation.CreateIndexes(typeof(RavenServiceOptions).Assembly, options.Store);
     factory.Register(new Registration <IAsyncDocumentSession>(resolver => options.Store.OpenAsyncSession(options.DatabaseName)));
 }