Skip to content

Instantly share code, notes, and snippets.

@marcioalthmann
Created April 30, 2012 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcioalthmann/2554759 to your computer and use it in GitHub Desktop.
Save marcioalthmann/2554759 to your computer and use it in GitHub Desktop.
Primeiros testes com o RavenDB
[TestClass]
public class RavenDbTests
{
private DocumentStore _documentStore;
[TestInitialize]
public void Inicializacao()
{
_documentStore = new DocumentStore{Url = "http://localhost:8080"};
_documentStore.Initialize();
}
[TestMethod]
public void QuandoUmAlbumEhIncluidoEleDeveGanharUmId()
{
var album = new Album { Nome = string.Format("Powerslave - {0}", DateTime.Now.ToShortTimeString()) };
using(IDocumentSession session = _documentStore.OpenSession())
{
session.Store(album);
session.SaveChanges();
}
Assert.AreNotEqual(null, album.Id);
}
}
public class Album
{
public string Id { get; set; }
public string Nome { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment