a6a4bd7ea6 | ||
---|---|---|
.github | ||
src | ||
.gitignore | ||
code_of_conduct.md | ||
license.txt | ||
readme.md |
readme.md
Verify.RavenDB
Extends Verify to allow verification of RavenDB bits.
See Milestones for release notes.
NuGet package
https://nuget.org/packages/Verify.RavenDB/
Enable
Enable VerifyRavenDB once at assembly load time:
[ModuleInitializer]
public static void Init() =>
VerifyRavenDB.Initialize();
Usage
Verifiying an IDocumentSession will result in all pending changes being written to a snapshot.
Document added
Adding a document to a session:
var entity = new Person
{
Name = "John"
};
session.Store(entity);
await Verify(session);
Will result in the following verified file:
[
{
Key: people/1-A,
Changes: [
{
Type: DocumentAdded,
NewValue: {
Name: John
}
}
]
}
]
Document updated
Updating a document in a session:
var entity = new Person
{
Name = "John"
};
session.Store(entity);
session.SaveChanges();
entity.Name = "Joe";
await Verify(session);
Will result in the following verified file:
[
{
Key: people/1-A,
Changes: [
{
Type: FieldChanged,
FieldName: Name,
NewValue: Joe,
OldValue: John
}
]
}
]
Icon
Raven designed by Maciej Świerczek from The Noun Project.