Ejemplo n.º 1
0
        public async Task VerifyAsync_WhenReaderIsNull_Throws()
        {
            var exception = await Assert.ThrowsAsync <ArgumentNullException>(
                () => _verifier.VerifyAsync(reader: null, cancellationToken: CancellationToken.None));

            Assert.Equal("reader", exception.ParamName);
        }
Ejemplo n.º 2
0
            public async Task VerifyAsync_WithValidCountersignature_ReturnsValid()
            {
                var timestampService = await _fixture.GetDefaultTrustedTimestampServiceAsync();

                using (var test = await Test.CreateAuthorSignedRepositoryCountersignedPackageAsync(
                           _fixture.TrustedTestCertificate.Source.Cert,
                           _fixture.TrustedRepositoryCertificate.Source.Cert,
                           timestampService.Url,
                           timestampService.Url))
                    using (var packageReader = new PackageArchiveReader(test.PackageFile.FullName))
                    {
                        var status = await _verifier.VerifyAsync(packageReader, CancellationToken.None);

                        Assert.Equal(SignatureVerificationStatus.Valid, status);
                    }
            }