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