예제 #1
0
        public void GetDescription_ImageDescription_GetImageDescription()
        {
            // Arrange
            IImage image        = new ImageClass("path", ".html", 1, 1);
            var    documentItem = new DocumentItem(image);

            // Act
            string description = documentItem.GetDescription();

            // Assert
            Assert.Equal(expected: "Image: 1 1 path", description);
        }
예제 #2
0
        public void Resize_ResizeWidthAndHeight_CorrectSizes()
        {
            // Arrange
            IImage image     = new Command.Image.Image("", "", width: 1, height: 1);
            int    newHeight = 2;
            int    newWidth  = 2;

            // Act
            image.Resize(newWidth, newHeight);

            // Assert
            Assert.Equal(newWidth, image.Width);
            Assert.Equal(newHeight, image.Height);
        }
예제 #3
0
        public void Resize_SizeMoreThanMax_SetMaxSizes()
        {
            // Arrange
            IImage image     = new Command.Image.Image("", "", width: 1, height: 1);
            int    newHeight = 11111111;
            int    newWidth  = 11111111;
            int    maxWidth  = 10000;
            int    maxHeight = 10000;

            // Act
            image.Resize(newWidth, newHeight);

            // Assert
            Assert.Equal(maxWidth, image.Width);
            Assert.Equal(maxHeight, image.Height);
        }