浏览代码

Unit test cleanup

Tig 8 月之前
父节点
当前提交
374304674d

+ 6 - 0
Terminal.Gui/View/View.Drawing.cs

@@ -366,12 +366,15 @@ public partial class View // Drawing APIs
     /// <returns><see langword="true"/> to stop further drawing of  <see cref="Text"/>.</returns>
     protected virtual bool OnDrawingText () { return false; }
 
+
+#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
     /// <summary>Raised when the <see cref="Text"/> of the View is to be drawn.</summary>
     /// <returns>
     ///     Set <see cref="DrawEventArgs.Cancel"/> to <see langword="true"/> to stop further drawing of
     ///     <see cref="Text"/>.
     /// </returns>
     public event EventHandler<DrawEventArgs>? DrawingText;
+#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
 
     /// <summary>
     ///     Draws the <see cref="Text"/> of the View using the <see cref="TextFormatter"/>.
@@ -468,6 +471,8 @@ public partial class View // Drawing APIs
     /// <returns><see langword="true"/> to stop further drawing of <see cref="Subviews"/>.</returns>
     protected virtual bool OnDrawingSubviews () { return false; }
 
+
+#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
     /// <summary>Raised when the <see cref="Subviews"/> are to be drawn.</summary>
     /// <remarks>
     /// </remarks>
@@ -476,6 +481,7 @@ public partial class View // Drawing APIs
     ///     <see cref="Subviews"/>.
     /// </returns>
     public event EventHandler<DrawEventArgs>? DrawingSubviews;
+#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
 
     /// <summary>
     ///     Draws the <see cref="Subviews"/>.

+ 1 - 1
Terminal.Gui/View/View.Layout.cs

@@ -501,7 +501,7 @@ public partial class View // Layout APIs
                 newH = _height.Calculate (newY, superviewContentSize.Height, this, Dimension.Height);
             }
         }
-        catch (LayoutException le)
+        catch (LayoutException)
         {
             //Debug.WriteLine ($"A Dim/PosFunc function threw (typically this is because a dependent View was not laid out)\n{le}.");
             return false;

+ 1 - 1
UICatalog/Scenarios/AllViewsTester.cs

@@ -194,7 +194,7 @@ public class AllViewsTester : Scenario
             // X = Pos.Right(_layoutEditor),
             SuperViewRendersLineCanvas = true
         };
-        _eventLog.Border.Thickness = new (1);
+        _eventLog.Border!.Thickness = new (1);
         _eventLog.X = Pos.AnchorEnd () - 1;
         _eventLog.Y = 0;
 

+ 10 - 10
UnitTests/View/Draw/DrawTests.cs

@@ -18,7 +18,7 @@ public class DrawTests (ITestOutputHelper _output)
             Y = 1,
             Width = 3, Height = 3
         };
-        view.Margin.Thickness = new (1);
+        view.Margin!.Thickness = new (1);
 
         // Only valid location w/in Viewport is 0, 0 (view) - 2, 2 (screen)
 
@@ -42,7 +42,7 @@ public class DrawTests (ITestOutputHelper _output)
             Y = 1,
             Width = 3, Height = 3
         };
-        view.Padding.Thickness = new (1);
+        view.Padding!.Thickness = new (1);
         view.Padding.Diagnostics = ViewDiagnosticFlags.Thickness;
         view.BeginInit ();
         view.EndInit ();
@@ -315,7 +315,7 @@ public class DrawTests (ITestOutputHelper _output)
                    これは広いルーンラインです。
                    """,
         };
-        frameView.Border.LineStyle = LineStyle.Single;
+        frameView.Border!.LineStyle = LineStyle.Single;
         frameView.Border.Thickness = new (1, 0, 0, 0);
 
         top.Add (frameView);
@@ -338,7 +338,7 @@ public class DrawTests (ITestOutputHelper _output)
             Width = Dim.Auto (),
             BorderStyle = LineStyle.Single
         };
-        view.Border.Thickness = new (1, 0, 1, 0);
+        view.Border!.Thickness = new (1, 0, 1, 0);
 
         top.Add (view);
         top.Layout ();
@@ -451,7 +451,7 @@ public class DrawTests (ITestOutputHelper _output)
     public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Bottom ()
     {
         var view = new View { Width = 2, Height = 1, BorderStyle = LineStyle.Single };
-        view.Border.Thickness = new (1, 1, 1, 0);
+        view.Border!.Thickness = new (1, 1, 1, 0);
         view.BeginInit ();
         view.EndInit ();
         view.SetRelativeLayout (Application.Screen.Size);
@@ -469,7 +469,7 @@ public class DrawTests (ITestOutputHelper _output)
     public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Left ()
     {
         var view = new View { Width = 1, Height = 2, BorderStyle = LineStyle.Single };
-        view.Border.Thickness = new (0, 1, 1, 1);
+        view.Border!.Thickness = new (0, 1, 1, 1);
         view.BeginInit ();
         view.EndInit ();
         view.SetRelativeLayout (Application.Screen.Size);
@@ -494,7 +494,7 @@ public class DrawTests (ITestOutputHelper _output)
     public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Right ()
     {
         var view = new View { Width = 1, Height = 2, BorderStyle = LineStyle.Single };
-        view.Border.Thickness = new (1, 1, 0, 1);
+        view.Border!.Thickness = new (1, 1, 0, 1);
         view.BeginInit ();
         view.EndInit ();
         view.SetRelativeLayout (Application.Screen.Size);
@@ -519,7 +519,7 @@ public class DrawTests (ITestOutputHelper _output)
     public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Top ()
     {
         var view = new View { Width = 2, Height = 1, BorderStyle = LineStyle.Single };
-        view.Border.Thickness = new (1, 0, 1, 1);
+        view.Border!.Thickness = new (1, 0, 1, 1);
 
         view.BeginInit ();
         view.EndInit ();
@@ -964,7 +964,7 @@ public class DrawTests (ITestOutputHelper _output)
             ViewportSettings = ViewportSettings.ClipContentOnly
         };
         view.SetContentSize (new Size (10, 10));
-        view.Border.Thickness = new (1);
+        view.Border!.Thickness = new (1);
         view.BeginInit ();
         view.EndInit ();
         Assert.Equal (view.Frame, View.GetClip ()!.GetBounds ());
@@ -997,7 +997,7 @@ public class DrawTests (ITestOutputHelper _output)
             Height = Dim.Fill ()
         };
         view.SetContentSize (new Size (10, 10));
-        view.Border.Thickness = new (1);
+        view.Border!.Thickness = new (1);
         view.BeginInit ();
         view.EndInit ();
         Assert.Equal (view.Frame, View.GetClip ()!.GetBounds ());