After following RavenDB's documentation
http://ravendb.net/docs/article-page/2.5/csharp/samples/raven-tests/createraventests
I am not able to successfully get a unit test to run past the creation of the in memory document store. I copy and pasted the test sample found in the documentation above using RavenDB's RavenTestBase.
[TestClass]
public class IndexTest : RavenTestBase
{
[TestMethod]
public void CanIndexAndQuery()
{
using (var store = NewDocumentStore())
{
new SampleData_Index().Execute(store);
using (var session = store.OpenSession())
{
session.Store(new SampleData
{
Name = "RavenDB"
});
session.SaveChanges();
}
using (var session = store.OpenSession())
{
var result = session.Query<SampleData, SampleData_Index>()
.Customize(customization => customization.WaitForNonStaleResultsAsOfNow())
.FirstOrDefault();
Assert.Equals(result.Name, "RavenDB");
}
}
}
}
public class SampleData
{
public string Name { get; set; }
}
public class SampleData_Index : AbstractIndexCreationTask<SampleData>
{
public SampleData_Index()
{
Map = docs => from doc in docs
select new
{
doc.Name
};
}
}
Upon reaching NewDocumentStore()... I receive the following exception:
"Exception was unhandled by user code Voron is prone to failure in 32-bits mode. Use Raven/Voron/AllowOn32Bits to force voron in 32-bit process."
I am using Visual Studio 2013 (Update 4) and RavenDB 3.0
Thanks!
In the constructor for NewDocumentStore pass in the configureStore parameter. This is an Action that takes the EmbeddableDocumentStore as its parameter. Within that action you can set different parts of the Configuration, including the AllowOn32Bits property.
public void ConfigureTestStore(EmbeddableDocumentStore documentStore)
{
documentStore.Configuration.Storage.Voron.AllowOn32Bits = true;
}
Then pass this as the configureStore argument in the constructor.
using (var store = NewDocumentStore(configureStore:ConfigureTestStore))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With