Skip to content

Adds Verify support to verify Azure CosmosDB.

License

Notifications You must be signed in to change notification settings

VerifyTests/Verify.Cosmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify.Cosmos

Discussions Build status NuGet Status

Adds Verify support to verify Azure CosmosDB.

See Milestones for release notes.

NuGet package

https://nuget.org/packages/Verify.Cosmos/

Usage

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

snippet source | anchor

ItemResponse

A ItemResponse can be verified:

var response = await container.CreateItemAsync(
    item,
    new PartitionKey(item.LastName));
await Verify(response);

snippet source | anchor

Resulting in:

{
  RequestCharge: 7.4,
  Headers: {},
  StatusCode: Created,
  Resource: {
    Id: Guid_1,
    LastName: Andersen,
    Address: {
      State: WA,
      County: King,
      City: Seattle
    }
  }
}

snippet source | anchor

FeedResponse

A FeedResponse can be verified:

using var iterator = container.GetItemLinqQueryable<Family>()
    .Where(b => b.Id == item.Id)
    .ToFeedIterator();
var feedResponse = await iterator.ReadNextAsync();
await Verify(feedResponse);

snippet source | anchor

Resulting in:

{
  RequestCharge: 2.8,
  Count: 1,
  Headers: {},
  StatusCode: OK,
  Resource: [
    {
      Id: Guid_1,
      LastName: Andersen,
      Address: {
        State: WA,
        County: King,
        City: Seattle
      }
    }
  ]
}

snippet source | anchor

Icon

Approval designed by Mike Zuidgeest from The Noun Project.

About

Adds Verify support to verify Azure CosmosDB.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •