From 53df3eac2a2fa1a21e686b20e6097ef06a891cb6 Mon Sep 17 00:00:00 2001 From: Brandon Thetford Date: Tue, 20 Feb 2024 17:45:04 -0700 Subject: [PATCH] Change to behavior matching System.Drawing.Rectangle --- Terminal.Gui/Types/Rectangle.cs | 2 +- UnitTests/Types/RectangleTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Types/Rectangle.cs b/Terminal.Gui/Types/Rectangle.cs index e8026a43c..0b1c262b2 100644 --- a/Terminal.Gui/Types/Rectangle.cs +++ b/Terminal.Gui/Types/Rectangle.cs @@ -287,5 +287,5 @@ public struct Rectangle /// ToString Method /// Formats the Rectangle as a string in (x,y,w,h) notation. - public override string ToString () { return $"({X},{Y},{Width},{Height})"; } + public override string ToString () { return $"{{X={X},Y={Y},Width={Width},Height={Height}}}"; } } diff --git a/UnitTests/Types/RectangleTests.cs b/UnitTests/Types/RectangleTests.cs index 812f373af..2878d7071 100644 --- a/UnitTests/Types/RectangleTests.cs +++ b/UnitTests/Types/RectangleTests.cs @@ -513,7 +513,7 @@ public class RectangleTests 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})"; + string expectedString = $"{{X={r.X},Y={r.Y},Width={r.Width},Height={r.Height}}}"; Assert.Equal (expectedString, r.ToString ()); } }