Пример #1
0
        public void GetThumbnailSize_WidthIsNever0()
        {
            var size = ThumbnailGenerator.GetThumbnailSize(new Size(1, 1024), new Size(100, 100));

            Assert.AreEqual(1, size.Width);
            Assert.AreEqual(100, size.Height);
        }
Пример #2
0
        public void GetThumbnailSize_HigherHeight()
        {
            var size = ThumbnailGenerator.GetThumbnailSize(new Size(600, 800), new Size(200, 100));

            Assert.AreEqual(75, size.Width);
            Assert.AreEqual(100, size.Height);

            size = ThumbnailGenerator.GetThumbnailSize(new Size(600, 800), new Size(100, 200));
            Assert.AreEqual(100, size.Width);
            Assert.AreEqual(133, size.Height);
        }
Пример #3
0
 public void GetThumbnailSize_NegativeTargetHeight()
 {
     ThumbnailGenerator.GetThumbnailSize(new Size(10, 10), new Size(10, -10));
 }
Пример #4
0
 public void GetThumbnailSize_NegativeTargetWidth()
 {
     ThumbnailGenerator.GetThumbnailSize(new Size(10, 10), new Size(-10, 10));
 }
Пример #5
0
 public void GetThumbnailSize_ZeroOriginalImageHeight()
 {
     ThumbnailGenerator.GetThumbnailSize(new Size(10, 0), new Size(10, 10));
 }