示例#1
0
        public void Resize_Should_Resize_Height_To_Expected()
        {
            var expectedHeight   = 700;
            var actualDimensions = ImageResizeUtility.ResizeHeightMaintainAspectRatio(new Dimensions(350, 2100), expectedHeight);

            Assert.AreEqual(expectedHeight, actualDimensions.Height);
        }
示例#2
0
        public void Resize_Should_Maintain_AspectRatio_After_Height_Resize()
        {
            var expectedHeight = 700;
            var originalHeight = 1400;
            var originalWidth  = 688;

            var expectedAspectRatio = (float)originalWidth / (float)originalHeight;
            var actualDimensions    = ImageResizeUtility.ResizeHeightMaintainAspectRatio(new Dimensions(originalWidth, originalHeight), expectedHeight);

            Assert.AreEqual(expectedAspectRatio, actualDimensions.AspectRatio);
        }