c0shea / IdParser

Parses PDF417 AAMVA-compliant driver's licenses and ID cards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simplify tests by asserting to an expected object

c0shea opened this issue · comments

Rather than have each test duplicate dozens of asserts on the various properties such as

Assert.AreEqual("JOEY", idCard.FirstName);
Assert.AreEqual("TESTER", idCard.LastName);

the test should construct the expected object like

var expectedId = new DriversLicense
{
    FirstName = "JOEY",
    LastName = "TESTER"
}

and pass the actual and expected objects to a method that will assert each property.