public async Task Skips( RegistrationLeafValidator validator, PackageRegistrationLeafMetadata v2, PackageRegistrationLeafMetadata v3) { Assert.Equal(false, await validator.ShouldRunLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3)); }
public async Task PassesIfEqual( RegistrationLeafValidator validator, PackageRegistrationLeafMetadata v2, PackageRegistrationLeafMetadata v3) { await validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3); }
public async Task FailsIfUnequal( RegistrationLeafValidator validator, PackageRegistrationLeafMetadata v2, PackageRegistrationLeafMetadata v3) { await Assert.ThrowsAnyAsync <MetadataInconsistencyException>( () => validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3)); }
public async Task SpecialCasesReturnAsExpected( RegistrationLeafValidator validator, PackageRegistrationLeafMetadata v2, PackageRegistrationLeafMetadata 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); } }