Пример #1
0
        public void Create_WhenValidatorConfigIsNull_Throws()
        {
            var factory = new PackageValidatorFactory(_loggerFactory.Object);

            var exception = Assert.Throws <ArgumentNullException>(
                () => factory.Create(
                    _galleryUrl,
                    _indexUrl,
                    _auditingStorageFactory,
                    Enumerable.Empty <EndpointFactory.Input>(),
                    _messageHandlerFactory,
                    validatorConfig: null));

            Assert.Equal("validatorConfig", exception.ParamName);
        }
Пример #2
0
        public void Create_WhenIndexUrlIsNullOrEmpty_Throws(string indexUrl)
        {
            var factory = new PackageValidatorFactory(_loggerFactory.Object);

            var exception = Assert.Throws <ArgumentException>(
                () => factory.Create(
                    _galleryUrl,
                    indexUrl,
                    _auditingStorageFactory,
                    Enumerable.Empty <EndpointFactory.Input>(),
                    _messageHandlerFactory,
                    _validatorConfiguration));

            Assert.Equal("indexUrl", exception.ParamName);
            Assert.StartsWith("The argument must not be null or empty.", exception.Message);
        }
Пример #3
0
        public void Create_WhenMessageHandlerFactoryIsNull_Throws()
        {
            var factory = new PackageValidatorFactory(_loggerFactory.Object);

            const Func <HttpMessageHandler> messageHandlerFactory = null;

            var exception = Assert.Throws <ArgumentNullException>(
                () => factory.Create(
                    _galleryUrl,
                    _indexUrl,
                    _auditingStorageFactory,
                    Enumerable.Empty <EndpointFactory.Input>(),
                    messageHandlerFactory,
                    _validatorConfiguration));

            Assert.Equal("messageHandlerFactory", exception.ParamName);
        }
Пример #4
0
        public void Create_WhenEndpointInputsIsNull_Throws()
        {
            var factory = new PackageValidatorFactory(_loggerFactory.Object);

            const IEnumerable <EndpointFactory.Input> endpointInputs = null;

            var exception = Assert.Throws <ArgumentNullException>(
                () => factory.Create(
                    _galleryUrl,
                    _indexUrl,
                    _auditingStorageFactory,
                    endpointInputs,
                    _messageHandlerFactory,
                    _validatorConfiguration));

            Assert.Equal("endpointInputs", exception.ParamName);
        }