Created
August 20, 2010 10:53
-
-
Save ryansroberts/540063 to your computer and use it in GitHub Desktop.
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
public class SyndicatedContent | |
{ | |
public string Id { get; set; } | |
public JObject unknown { get; set; } | |
public XDocument doc { get; set; } | |
} | |
[Subject("Document storage")] | |
public class When_storing_content | |
{ | |
static DocumentStore store; | |
static IDocumentSession session; | |
static string id; | |
Establish context = () => | |
{ | |
store = new DocumentStore() {DataDirectory = "./data"}; | |
store.Initialize(); | |
session = store.OpenSession(); | |
}; | |
Because of = () => | |
{ | |
SyndicatedContent entry; | |
session.Store(entry = new SyndicatedContent | |
{ | |
unknown = JObject.Parse("{bob : [1,2,3,4]})"), | |
doc = XDocument.Parse("<blah></blah>") | |
}); | |
session.SaveChanges(); | |
id = entry.Id; | |
session.Evict(entry); | |
}; | |
It has_the_document = () => session.Load < SyndicatedContent>(id) | |
.unknown.ShouldNotBeNull(); | |
It has_the_xml_document = () => session.Load<SyndicatedContent>(id) | |
.doc.ShouldNotBeNull(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment