public FactsBase()
            {
                _validatorStateService    = new Mock <IValidatorStateService>();
                _packageSignatureVerifier = new Mock <IPackageSignatureVerificationEnqueuer>();
                _logger = new Mock <ILogger <PackageSigningValidator> >();

                _validationRequest = new Mock <IValidationRequest>();
                _validationRequest.Setup(x => x.NupkgUrl).Returns(NupkgUrl);
                _validationRequest.Setup(x => x.PackageId).Returns(PackageId);
                _validationRequest.Setup(x => x.PackageKey).Returns(PackageKey);
                _validationRequest.Setup(x => x.PackageVersion).Returns(PackageVersion);
                _validationRequest.Setup(x => x.ValidationId).Returns(ValidationId);

                _target = new PackageSigningValidator(
                    _validatorStateService.Object,
                    _packageSignatureVerifier.Object,
                    _logger.Object);
            }
Esempio n. 2
0
            public FactsBase(ITestOutputHelper output)
            {
                _validatorStateService    = new Mock <IValidatorStateService>();
                _packageSignatureVerifier = new Mock <IProcessSignatureEnqueuer>();
                _blobProvider             = new Mock <ISimpleCloudBlobProvider>();
                _telemetryService         = new Mock <ITelemetryService>();
                var loggerFactory = new LoggerFactory().AddXunit(output);

                _logger = loggerFactory.CreateLogger <PackageSigningValidator>();

                _validationRequest = new Mock <IValidationRequest>();
                _validationRequest.Setup(x => x.NupkgUrl).Returns(NupkgUrl);
                _validationRequest.Setup(x => x.PackageId).Returns(PackageId);
                _validationRequest.Setup(x => x.PackageKey).Returns(PackageKey);
                _validationRequest.Setup(x => x.PackageVersion).Returns(PackageVersion);
                _validationRequest.Setup(x => x.ValidationId).Returns(ValidationId);

                _target = new PackageSigningValidator(
                    _validatorStateService.Object,
                    _packageSignatureVerifier.Object,
                    _blobProvider.Object,
                    _telemetryService.Object,
                    _logger);
            }