public async Task PassesIfEqual(
     RegistrationLeafValidator validator,
     PackageRegistrationIndexMetadata v2,
     PackageRegistrationIndexMetadata v3)
 {
     await validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3);
 }
 public async Task FailsIfUnequal(
     RegistrationLeafValidator validator,
     PackageRegistrationIndexMetadata v2,
     PackageRegistrationIndexMetadata v3)
 {
     await Assert.ThrowsAnyAsync <MetadataInconsistencyException>(
         () => validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3));
 }
                public async Task SpecialCasesReturnAsExpected(
                    RegistrationLeafValidator validator,
                    PackageRegistrationIndexMetadata v2,
                    PackageRegistrationIndexMetadata v3,
                    bool shouldPass)
                {
                    var compareTask = Task.Run(async() => await validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3));

                    if (shouldPass)
                    {
                        await compareTask;
                    }
                    else
                    {
                        await Assert.ThrowsAnyAsync <MetadataInconsistencyException>(
                            () => compareTask);
                    }
                }