Created
January 17, 2011 15:43
-
-
Save bennage/782984 to your computer and use it in GitHub Desktop.
example of a Raven client test on the .NET side
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
[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