Created
November 14, 2013 16:00
-
-
Save hyrmn/7469287 to your computer and use it in GitHub Desktop.
wireup for ravendb + indexes in unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static using_a_wired_environment() | |
| { | |
| DocumentStore = new EmbeddableDocumentStore | |
| { | |
| RunInMemory = true, | |
| Conventions = { JsonContractResolver = new RavenContractResolver(true), MaxNumberOfRequestsPerSession = int.MaxValue, } | |
| }; | |
| DocumentStore.Conventions.CustomizeJsonSerializer = jsonSerializer => { jsonSerializer.ConfigureForNodaTime(DateTimeZoneProviders.Bcl); }; | |
| DocumentStore.RegisterListener(new NoStaleQueriesAllowed()); | |
| DocumentStore.Initialize(); | |
| CreateDefaultIndexes(DocumentStore); | |
| var idx1 = DocumentStore.DatabaseCommands.GetIndex("UserProjection/ByEmail"); | |
| var idx = DocumentStore.DatabaseCommands.GetIndex("PosItemProjection/ByCategoryId"); | |
| } | |
| private static void CreateDefaultIndexes(IDocumentStore documentStore) | |
| { | |
| IndexCreation.CreateIndexes(typeof(UserProjection_ByEmail).Assembly, DocumentStore); | |
| new RavenDocumentsByEntityName().Execute(documentStore); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment