Browse Source

Add baseline test for ToString checking for current behavior.

Brandon Thetford 1 year ago
parent
commit
e38933d3d6
1 changed files with 9 additions and 0 deletions
  1. 9 0
      UnitTests/Types/RectangleTests.cs

+ 9 - 0
UnitTests/Types/RectangleTests.cs

@@ -507,4 +507,13 @@ public class RectangleTests
         Rectangle result = Rectangle.Union (r1, r2);
         Assert.Equal (new Rectangle (0, 0, 2, 2), result);
     }
+
+    [Theory]
+    [CombinatorialData]
+    public void ToString_ReturnsExpectedString ([CombinatorialValues(-1,0,1)]int x, [CombinatorialValues(-1,0,1)]int y, [CombinatorialValues(1,10)]int width, [CombinatorialValues(1,10)]int height)
+    {
+        Rectangle r = new (x, y, width, height);
+        string expectedString = $"({r.X},{r.Y},{r.Width},{r.Height})";
+        Assert.Equal (expectedString, r.ToString ());
+    }
 }