public virtual void PrepareRectangleSpaceSpaceNoAvailableSpaceTest() { BackgroundRepeat repeat = new BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue.SPACE); Rectangle imageRect = new Rectangle(0, -5, 50, 60); Rectangle originalRect = new Rectangle(imageRect); Rectangle availableArea = new Rectangle(0, 0, 45, 55); Point whitespace = repeat.PrepareRectangleToDrawingAndGetWhitespace(imageRect, availableArea, new BackgroundSize ()); NUnit.Framework.Assert.AreEqual(0, whitespace.GetX(), EPSILON); NUnit.Framework.Assert.AreEqual(0, whitespace.GetY(), EPSILON); NUnit.Framework.Assert.IsTrue(originalRect.EqualsWithEpsilon(imageRect)); }
public virtual void PrepareRectangleRoundRoundLessHalfImageSizeTest() { BackgroundRepeat repeat = new BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue.ROUND); Rectangle imageRect = new Rectangle(0, 0, 50, 70); Rectangle availableArea = new Rectangle(0, 0, 120, 160); Point whitespace = repeat.PrepareRectangleToDrawingAndGetWhitespace(imageRect, availableArea, new BackgroundSize ()); NUnit.Framework.Assert.AreEqual(0, whitespace.GetX(), EPSILON); NUnit.Framework.Assert.AreEqual(0, whitespace.GetY(), EPSILON); NUnit.Framework.Assert.AreEqual(0, imageRect.GetX(), EPSILON); NUnit.Framework.Assert.AreEqual(-10, imageRect.GetY(), EPSILON); NUnit.Framework.Assert.AreEqual(60, imageRect.GetWidth(), EPSILON); NUnit.Framework.Assert.AreEqual(80, imageRect.GetHeight(), EPSILON); }