public virtual void NoneModeContainerIsLessThanImageTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.NONE, BIG_WIDTH, BIG_HEIGHT, SMALL_WIDTH, SMALL_HEIGHT); NUnit.Framework.Assert.AreEqual(BIG_WIDTH, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(BIG_HEIGHT, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsTrue(result.IsImageCuttingRequired()); }
public virtual void FillModeContainerIsVerticalAndImageIsHorizontalTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.FILL, SMALL_WIDTH , BIG_HEIGHT, BIG_WIDTH, SMALL_HEIGHT); NUnit.Framework.Assert.AreEqual(BIG_WIDTH, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(SMALL_HEIGHT, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsFalse(result.IsImageCuttingRequired()); }
public virtual void ScaleDownModeContainerIsGreaterThanImageTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.SCALE_DOWN, SMALL_WIDTH , SMALL_HEIGHT, BIG_WIDTH, BIG_HEIGHT); NUnit.Framework.Assert.AreEqual(SMALL_WIDTH, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(SMALL_HEIGHT, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsFalse(result.IsImageCuttingRequired()); }
public virtual void ScaleDownModeContainerIsVerticalAndImageIsHorizontalTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.SCALE_DOWN, SMALL_WIDTH , BIG_HEIGHT, BIG_WIDTH, SMALL_HEIGHT); float expectedWidth = SMALL_WIDTH / BIG_HEIGHT * SMALL_HEIGHT; NUnit.Framework.Assert.AreEqual(expectedWidth, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(SMALL_HEIGHT, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsFalse(result.IsImageCuttingRequired()); }
public virtual void CoverModeContainerIsVerticalAndImageIsHorizontalTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.COVER, SMALL_WIDTH , BIG_HEIGHT, BIG_WIDTH, SMALL_HEIGHT); float expectedHeight = BIG_HEIGHT / SMALL_WIDTH * BIG_WIDTH; NUnit.Framework.Assert.AreEqual(BIG_WIDTH, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(expectedHeight, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsTrue(result.IsImageCuttingRequired()); }
public virtual void CoverModeContainerIsLessThanImageTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.COVER, BIG_WIDTH , BIG_HEIGHT, SMALL_WIDTH, SMALL_HEIGHT); float expectedWidth = BIG_WIDTH / BIG_HEIGHT * SMALL_HEIGHT; NUnit.Framework.Assert.AreEqual(expectedWidth, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(SMALL_HEIGHT, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsTrue(result.IsImageCuttingRequired()); }
public virtual void ContainModeContainerIsGreaterThanImageTest() { ObjectFitApplyingResult result = ObjectFitCalculator.CalculateRenderedImageSize(ObjectFit.CONTAIN, SMALL_WIDTH , SMALL_HEIGHT, BIG_WIDTH, BIG_HEIGHT); float expectedWidth = SMALL_WIDTH / SMALL_HEIGHT * BIG_HEIGHT; NUnit.Framework.Assert.AreEqual(expectedWidth, result.GetRenderedImageWidth(), 0.1); NUnit.Framework.Assert.AreEqual(BIG_HEIGHT, result.GetRenderedImageHeight(), 0.1); NUnit.Framework.Assert.IsFalse(result.IsImageCuttingRequired()); }