When validating multiple instances, an anonymous type can be used for verification
[Fact]
public Task Anon()
{
var person1 = new Person
{
GivenNames = "John",
FamilyName = "Smith"
};
var person2 = new Person
{
GivenNames = "Marianne",
FamilyName = "Aguirre"
};
return Verifier.Verify(
new
{
person1,
person2
});
}
[Test]
public async Task Anon()
{
var person1 = new Person
{
GivenNames = "John",
FamilyName = "Smith"
};
var person2 = new Person
{
GivenNames = "Marianne",
FamilyName = "Aguirre"
};
await Verifier.Verify(
new
{
person1,
person2
});
}
[TestMethod]
public async Task Anon()
{
var person1 = new Person
{
GivenNames = "John",
FamilyName = "Smith"
};
var person2 = new Person
{
GivenNames = "Marianne",
FamilyName = "Aguirre"
};
await Verify(
new
{
person1,
person2
});
}
Results in the following:
{
person1: {
GivenNames: John,
FamilyName: Smith
},
person2: {
GivenNames: Marianne,
FamilyName: Aguirre
}
}