示例#1
0
        public void ReturnUntouchedImage()
        {
            // Assign
            var width  = 1600;
            var height = 500;

            var imageService = new Services.ImageService.ImageService();
            var image        = new Image <Rgba32>(width, height);

            // Act
            var cropedImage = imageService.CropAndResizeImage(image, width, height);

            // Assert
            Assert.NotEqual(image, cropedImage);
            Assert.Equal(image.Width, cropedImage.Width);
            Assert.Equal(image.Height, cropedImage.Height);
        }
示例#2
0
        public void ReturnCropedAndResizedImage()
        {
            // Assign
            var width  = 1600;
            var height = 500;

            var imageService = new Services.ImageService.ImageService();
            var image        = new Image <Rgba32>(width, height);

            // Act
            var cropedImage = imageService.CropAndResizeImage(image, width: 900, height: 390);

            // Assert
            Assert.NotEqual(cropedImage, image);
            Assert.NotEqual(cropedImage.Width, image.Width);
            Assert.NotEqual(cropedImage.Height, image.Height);
            Assert.Equal(cropedImage.Width, 900);
            Assert.Equal(cropedImage.Height, 390);
        }