コード例 #1
0
 public async Task PassesIfEqual(
     RegistrationLeafValidator validator,
     PackageRegistrationIndexMetadata v2,
     PackageRegistrationIndexMetadata v3)
 {
     await validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3);
 }
コード例 #2
0
 public async Task FailsIfUnequal(
     RegistrationLeafValidator validator,
     PackageRegistrationIndexMetadata v2,
     PackageRegistrationIndexMetadata v3)
 {
     await Assert.ThrowsAnyAsync <MetadataInconsistencyException>(
         () => validator.CompareLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3));
 }
コード例 #3
0
                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);
                    }
                }
コード例 #4
0
 public async Task Skips(
     RegistrationLeafValidator validator,
     PackageRegistrationLeafMetadata v2,
     PackageRegistrationLeafMetadata v3)
 {
     Assert.Equal(ShouldRunTestResult.No, await validator.ShouldRunLeafAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3));
 }
コード例 #5
0
 public async Task Runs(
     RegistrationIndexValidator validator,
     PackageRegistrationIndexMetadata v2,
     PackageRegistrationIndexMetadata v3)
 {
     Assert.Equal(ShouldRunTestResult.Yes, await validator.ShouldRunIndexAsync(ValidatorTestUtility.GetFakeValidationContext(), v2, v3));
 }