DrawContextTests.cs 761 B

1234567891011121314151617181920
  1. namespace UnitTests_Parallelizable.DrawingTests;
  2. public class DrawContextTests
  3. {
  4. [Fact (Skip = "Region Union is broken")]
  5. public void AddDrawnRectangle_Unions ()
  6. {
  7. DrawContext drawContext = new DrawContext ();
  8. drawContext.AddDrawnRectangle (new (0, 0, 1, 1));
  9. drawContext.AddDrawnRectangle (new (1, 0, 1, 1));
  10. Assert.Equal (new Rectangle (0, 0, 2, 1), drawContext.GetDrawnRegion ().GetBounds ());
  11. Assert.Equal (2, drawContext.GetDrawnRegion ().GetRectangles ().Length);
  12. drawContext.AddDrawnRectangle (new (0, 0, 4, 1));
  13. Assert.Equal (new Rectangle (0, 1, 4, 1), drawContext.GetDrawnRegion ().GetBounds ());
  14. Assert.Single (drawContext.GetDrawnRegion ().GetRectangles ());
  15. }
  16. }