FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

VerifyTests/Verify.RavenDB: Extends Verify to allow verification of RavenDB bits. · GitHub

Repository files navigation

Verify.RavenDB

Extends Verify to allow verification of RavenDB bits.

See Milestones for release notes.

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Developed using JetBrains IDEs

NuGet

Enable

Enable VerifyRavenDB once at assembly load time:

[ModuleInitializer]
public static void Init() =>
    VerifyRavenDB.Initialize();

snippet source | anchor

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);

snippet source | anchor

Will result in the following verified file:

[
  {
    Key: people/1-A,
    Changes: [
      {
        Type: DocumentAdded,
        NewValue: {
          Name: John
        }
      }
    ]
  }
]

snippet source | anchor

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);

snippet source | anchor

Will result in the following verified file:

[
  {
    Key: people/1-A,
    Changes: [
      {
        Type: FieldChanged,
        FieldName: Name,
        NewValue: Joe,
        OldValue: John
      }
    ]
  }
]

snippet source | anchor

Icon

Raven designed by Maciej Świerczek from The Noun Project.

About

Extends Verify to allow verification of RavenDB bits.

Topics

Resources

Code of conduct

Stars

2 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL