Browse Source

Fix this test for release builds

Brandon Thetford 1 year ago
parent
commit
736eea1469
1 changed files with 5 additions and 4 deletions
  1. 5 4
      UnitTests/Views/WindowTests.cs

+ 5 - 4
UnitTests/Views/WindowTests.cs

@@ -160,10 +160,11 @@ public class WindowTests
         Assert.Equal (LayoutStyle.Absolute, windowWithFrameRectEmpty.LayoutStyle);
         Assert.Equal (LayoutStyle.Absolute, windowWithFrameRectEmpty.LayoutStyle);
         // TODO: Fix things so that this works in release and debug
         // TODO: Fix things so that this works in release and debug
         // BUG: This also looks like it might be unintended behavior.
         // BUG: This also looks like it might be unintended behavior.
+        // Can actually also be removed, since the tests below make it redundant.
     #if DEBUG
     #if DEBUG
         Assert.Equal ($"Window(title){windowWithFrameRectEmpty.Frame}", windowWithFrameRectEmpty.ToString ());
         Assert.Equal ($"Window(title){windowWithFrameRectEmpty.Frame}", windowWithFrameRectEmpty.ToString ());
     #else
     #else
-        Assert.Equal ("Window()(0,0,0,0)", windowWithFrameRectEmpty.ToString ());
+        Assert.Equal ($"Window(){windowWithFrameRectEmpty.Frame}", windowWithFrameRectEmpty.ToString ());
     #endif
     #endif
         Assert.True (windowWithFrameRectEmpty.CanFocus);
         Assert.True (windowWithFrameRectEmpty.CanFocus);
         Assert.False (windowWithFrameRectEmpty.HasFocus);
         Assert.False (windowWithFrameRectEmpty.HasFocus);
@@ -196,12 +197,12 @@ public class WindowTests
     #if DEBUG
     #if DEBUG
         Assert.Equal ($"Window(title){windowWithFrame1234.Frame}", windowWithFrame1234.ToString ());
         Assert.Equal ($"Window(title){windowWithFrame1234.Frame}", windowWithFrame1234.ToString ());
     #else
     #else
-        Assert.Equal ("Window()(1,2,3,4)", windowWithFrame1234.ToString ());
+        Assert.Equal ($"Window(){windowWithFrame1234.Frame}", windowWithFrame1234.ToString ());
     #endif
     #endif
         Assert.True (windowWithFrame1234.CanFocus);
         Assert.True (windowWithFrame1234.CanFocus);
         Assert.False (windowWithFrame1234.HasFocus);
         Assert.False (windowWithFrame1234.HasFocus);
-        Assert.Equal (new Rectangle (0, 0, 1, 2), windowWithFrame1234.Bounds);
-        Assert.Equal (new Rectangle (1, 2, 3, 4), windowWithFrame1234.Frame);
+        Assert.Equal (new (0, 0, 1, 2), windowWithFrame1234.Bounds);
+        Assert.Equal (new (1, 2, 3, 4), windowWithFrame1234.Frame);
         Assert.Null (windowWithFrame1234.Focused);
         Assert.Null (windowWithFrame1234.Focused);
         Assert.NotNull (windowWithFrame1234.ColorScheme);
         Assert.NotNull (windowWithFrame1234.ColorScheme);
         Assert.Equal (1, windowWithFrame1234.X);
         Assert.Equal (1, windowWithFrame1234.X);