public Versioning()
{
path = Path.GetDirectoryName(Assembly.GetAssembly(typeof(Versioning)).CodeBase);
path = Path.Combine(path, "TestDb").Substring(6);
database::Raven.Database.Extensions.IOExtensions.DeleteDirectory(path);
ravenDbServer = new RavenDbServer(
new database::Raven.Database.Config.RavenConfiguration
{
Port = 8080,
DataDirectory = path,
RunInUnreliableYetFastModeThatIsNotSuitableForProduction = true,
Catalog =
{
Catalogs =
{
new AssemblyCatalog(typeof (VersioningPutTrigger).Assembly)
}
},
});
documentStore = new DocumentStore
{
Url = "http://localhost:8080"
};
documentStore.Initialize();
using(var s = documentStore.OpenSession())
{
s.Store(new VersioningConfiguration
{
Exclude = true,
Id = "Raven/Versioning/Users",
});
s.Store(new VersioningConfiguration
{
Exclude = true,
Id = "Raven/Versioning/Comments",
});
s.Store(new VersioningConfiguration
{
Exclude = false,
Id = "Raven/Versioning/DefaultConfiguration",
MaxRevisions = 5
});
s.SaveChanges();
}
}