Browse Source

Fix these tests the same way as the previous commit

Brandon Thetford 1 year ago
parent
commit
f0b2fb1820
2 changed files with 10 additions and 10 deletions
  1. 6 6
      UnitTests/View/Layout/PosTests.cs
  2. 4 4
      UnitTests/View/ViewTests.cs

+ 6 - 6
UnitTests/View/Layout/PosTests.cs

@@ -201,42 +201,42 @@ public class PosTests
         Pos pos = Pos.Left (v);
         Pos pos = Pos.Left (v);
 
 
         Assert.Equal (
         Assert.Equal (
-                      "View(side=x,target=View(V)(0,0,0,0))",
+                      $"View(side=x,target=View(V){v.Frame})",
                       pos.ToString ()
                       pos.ToString ()
                      );
                      );
 
 
         pos = Pos.X (v);
         pos = Pos.X (v);
 
 
         Assert.Equal (
         Assert.Equal (
-                      "View(side=x,target=View(V)(0,0,0,0))",
+                      $"View(side=x,target=View(V){v.Frame})",
                       pos.ToString ()
                       pos.ToString ()
                      );
                      );
 
 
         pos = Pos.Top (v);
         pos = Pos.Top (v);
 
 
         Assert.Equal (
         Assert.Equal (
-                      "View(side=y,target=View(V)(0,0,0,0))",
+                      $"View(side=y,target=View(V){v.Frame})",
                       pos.ToString ()
                       pos.ToString ()
                      );
                      );
 
 
         pos = Pos.Y (v);
         pos = Pos.Y (v);
 
 
         Assert.Equal (
         Assert.Equal (
-                      "View(side=y,target=View(V)(0,0,0,0))",
+                      $"View(side=y,target=View(V){v.Frame})",
                       pos.ToString ()
                       pos.ToString ()
                      );
                      );
 
 
         pos = Pos.Right (v);
         pos = Pos.Right (v);
 
 
         Assert.Equal (
         Assert.Equal (
-                      "View(side=right,target=View(V)(0,0,0,0))",
+                      $"View(side=right,target=View(V){v.Frame})",
                       pos.ToString ()
                       pos.ToString ()
                      );
                      );
 
 
         pos = Pos.Bottom (v);
         pos = Pos.Bottom (v);
 
 
         Assert.Equal (
         Assert.Equal (
-                      "View(side=bottom,target=View(V)(0,0,0,0))",
+                      $"View(side=bottom,target=View(V){v.Frame})",
                       pos.ToString ()
                       pos.ToString ()
                      );
                      );
     }
     }

+ 4 - 4
UnitTests/View/ViewTests.cs

@@ -1084,7 +1084,7 @@ At 0,0
         var r = new View ();
         var r = new View ();
         Assert.NotNull (r);
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ("View()(0,0,0,0)", r.ToString ());
+        Assert.Equal ($"View(){r.Bounds}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
         Assert.False (r.HasFocus);
         Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
         Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
@@ -1109,7 +1109,7 @@ At 0,0
         r = new View { Frame = Rectangle.Empty };
         r = new View { Frame = Rectangle.Empty };
         Assert.NotNull (r);
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ("View()(0,0,0,0)", r.ToString ());
+        Assert.Equal ($"View(){r.Bounds}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
         Assert.False (r.HasFocus);
         Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
         Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
@@ -1134,7 +1134,7 @@ At 0,0
         r = new View { Frame = new Rectangle (1, 2, 3, 4) };
         r = new View { Frame = new Rectangle (1, 2, 3, 4) };
         Assert.NotNull (r);
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ("View()(1,2,3,4)", r.ToString ());
+        Assert.Equal ($"View(){r.Frame}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
         Assert.False (r.HasFocus);
         Assert.Equal (new Rectangle (0, 0, 3, 4), r.Bounds);
         Assert.Equal (new Rectangle (0, 0, 3, 4), r.Bounds);
@@ -1167,7 +1167,7 @@ At 0,0
         r.BeginInit ();
         r.BeginInit ();
         r.EndInit ();
         r.EndInit ();
     #if DEBUG
     #if DEBUG
-        Assert.Equal ("View(Vertical View)(0,0,1,13)", r.ToString ());
+        Assert.Equal ($"View(Vertical View){r.Bounds}", r.ToString ());
     #else
     #else
         Assert.Equal ("View()(0,0,1,13)", r.ToString ());
         Assert.Equal ("View()(0,0,1,13)", r.ToString ());
     #endif
     #endif