Skip to content

Instantly share code, notes, and snippets.

@bennage
Created January 17, 2011 15:43
Show Gist options
  • Save bennage/782984 to your computer and use it in GitHub Desktop.
Save bennage/782984 to your computer and use it in GitHub Desktop.
example of a Raven client test on the .NET side
[Fact]
public void Can_insert_async_and_get_sync()
{
using (var server = GetNewServer(port, path))
{
var documentStore = new DocumentStore { Url = "http://localhost:" + port };
documentStore.Initialize();
var entity = new Company { Name = "Async Company" };
using (var session = documentStore.OpenAsyncSession())
{
session.Store(entity);
session.SaveChangesAsync().Wait();
}
using (var session = documentStore.OpenSession())
{
var company = session.Load<Company>(entity.Id);
Assert.Equal("Async Company", company.Name);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment