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); } }
public async Task Skips( RegistrationLeafValidator validator, PackageRegistrationLeafMetadata v2, PackageRegistrationLeafMetadata v3) { Assert.Equal(ShouldRunTestResult.No, await validator.ShouldRunLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3)); }
public async Task Runs( RegistrationIndexValidator validator, PackageRegistrationIndexMetadata v2, PackageRegistrationIndexMetadata v3) { Assert.Equal(ShouldRunTestResult.Yes, await validator.ShouldRunIndexAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3)); }