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