public void IsNotNull_Object_WhenObjectIsNotNull_DoesNothing()
        {
            //Arrange
            object argument = new object();

            //Act
            AssertArgument.IsNotNull(nameof(argument), argument);
        }
        public FileConverter(IFileProcessor fileProcessor,
                             List <Resolution> suppliedResolutions)
        {
            AssertArgument.IsNotNull(nameof(fileProcessor), fileProcessor);
            AssertArgument.IsNotNullOrEmpty(nameof(suppliedResolutions), suppliedResolutions);

            this.fileProcessor       = fileProcessor;
            this.suppliedResolutions = suppliedResolutions;
        }
        public SVGToPNGConverter(ISVGWrapper svgDocumentWrapper, IBitmapWrapper bitmapWrapper, IFileSystemProvider fileSystemProvider)
        {
            AssertArgument.IsNotNull(nameof(svgDocumentWrapper), svgDocumentWrapper);
            AssertArgument.IsNotNull(nameof(bitmapWrapper), bitmapWrapper);
            AssertArgument.IsNotNull(nameof(fileSystemProvider), fileSystemProvider);

            this.svgDocumentWrapper = svgDocumentWrapper;
            this.bitmapWrapper      = bitmapWrapper;
            this.fileSystemProvider = fileSystemProvider;
        }
Esempio n. 4
0
        public FileProcessor([Named(ConverterType.SVGToPNG)] IImageConverter svgToPNGConverter,
                             [Named(ConverterType.AIToSVG)] IImageConverter aiToSVGConverter)
        {
            AssertArgument.IsNotNull(nameof(svgToPNGConverter), svgToPNGConverter);
            AssertArgument.IsNotNull(nameof(aiToSVGConverter), aiToSVGConverter);

            this.aiToSVGConverter  = aiToSVGConverter;
            this.svgToPNGConverter = svgToPNGConverter;

            SkipSizeIterator = new List <ImageSize> {
                new ImageSize(1, 1)
            };
        }
        public void IsNotNull_Object_WhenObjectIsNull_ThrowsException()
        {
            //Arrange
            object argument     = null;
            string argumentName = "0AA69E84-F022-4B6A-AE13-4B69719E4C89";

            try
            {
                //Act
                AssertArgument.IsNotNull(argumentName, argument);
            }
            catch (Exception ex)
            {
                //Assert
                Assert.IsInstanceOfType(ex, typeof(ArgumentNullException));
                Assert.IsTrue(ex.Message.Contains(argumentName));
                return;
            }

            FailOnNoException();
        }
Esempio n. 6
0
        public AIToSVGConverter(IIllustratorProvider illustratorProvider)
        {
            AssertArgument.IsNotNull(nameof(illustratorProvider), illustratorProvider);

            this.illustratorProvider = illustratorProvider;
        }