Created
April 30, 2012 01:40
-
-
Save marcioalthmann/2554759 to your computer and use it in GitHub Desktop.
Primeiros testes com o RavenDB
This file contains 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
[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