Skip to content

Commit 3743046

Browse files
committed
Unit test cleanup
1 parent 9fc9438 commit 3743046

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

Terminal.Gui/View/View.Drawing.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,15 @@ private void DoDrawText ()
366366
/// <returns><see langword="true"/> to stop further drawing of <see cref="Text"/>.</returns>
367367
protected virtual bool OnDrawingText () { return false; }
368368

369+
370+
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
369371
/// <summary>Raised when the <see cref="Text"/> of the View is to be drawn.</summary>
370372
/// <returns>
371373
/// Set <see cref="DrawEventArgs.Cancel"/> to <see langword="true"/> to stop further drawing of
372374
/// <see cref="Text"/>.
373375
/// </returns>
374376
public event EventHandler<DrawEventArgs>? DrawingText;
377+
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
375378

376379
/// <summary>
377380
/// Draws the <see cref="Text"/> of the View using the <see cref="TextFormatter"/>.
@@ -468,6 +471,8 @@ private void DoDrawSubviews ()
468471
/// <returns><see langword="true"/> to stop further drawing of <see cref="Subviews"/>.</returns>
469472
protected virtual bool OnDrawingSubviews () { return false; }
470473

474+
475+
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
471476
/// <summary>Raised when the <see cref="Subviews"/> are to be drawn.</summary>
472477
/// <remarks>
473478
/// </remarks>
@@ -476,6 +481,7 @@ private void DoDrawSubviews ()
476481
/// <see cref="Subviews"/>.
477482
/// </returns>
478483
public event EventHandler<DrawEventArgs>? DrawingSubviews;
484+
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved
479485

480486
/// <summary>
481487
/// Draws the <see cref="Subviews"/>.

Terminal.Gui/View/View.Layout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public bool SetRelativeLayout (Size superviewContentSize)
501501
newH = _height.Calculate (newY, superviewContentSize.Height, this, Dimension.Height);
502502
}
503503
}
504-
catch (LayoutException le)
504+
catch (LayoutException)
505505
{
506506
//Debug.WriteLine ($"A Dim/PosFunc function threw (typically this is because a dependent View was not laid out)\n{le}.");
507507
return false;

UICatalog/Scenarios/AllViewsTester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public override void Main ()
194194
// X = Pos.Right(_layoutEditor),
195195
SuperViewRendersLineCanvas = true
196196
};
197-
_eventLog.Border.Thickness = new (1);
197+
_eventLog.Border!.Thickness = new (1);
198198
_eventLog.X = Pos.AnchorEnd () - 1;
199199
_eventLog.Y = 0;
200200

UnitTests/View/Draw/DrawTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void Move_Is_Constrained_To_Viewport ()
1818
Y = 1,
1919
Width = 3, Height = 3
2020
};
21-
view.Margin.Thickness = new (1);
21+
view.Margin!.Thickness = new (1);
2222

2323
// Only valid location w/in Viewport is 0, 0 (view) - 2, 2 (screen)
2424

@@ -42,7 +42,7 @@ public void AddRune_Is_Constrained_To_Viewport ()
4242
Y = 1,
4343
Width = 3, Height = 3
4444
};
45-
view.Padding.Thickness = new (1);
45+
view.Padding!.Thickness = new (1);
4646
view.Padding.Diagnostics = ViewDiagnosticFlags.Thickness;
4747
view.BeginInit ();
4848
view.EndInit ();
@@ -315,7 +315,7 @@ public void Clipping_Wide_Runes ()
315315
これは広いルーンラインです。
316316
""",
317317
};
318-
frameView.Border.LineStyle = LineStyle.Single;
318+
frameView.Border!.LineStyle = LineStyle.Single;
319319
frameView.Border.Thickness = new (1, 0, 0, 0);
320320

321321
top.Add (frameView);
@@ -338,7 +338,7 @@ public void Clipping_Wide_Runes ()
338338
Width = Dim.Auto (),
339339
BorderStyle = LineStyle.Single
340340
};
341-
view.Border.Thickness = new (1, 0, 1, 0);
341+
view.Border!.Thickness = new (1, 0, 1, 0);
342342

343343
top.Add (view);
344344
top.Layout ();
@@ -451,7 +451,7 @@ public void Draw_Minimum_Full_Border_With_Empty_Viewport ()
451451
public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Bottom ()
452452
{
453453
var view = new View { Width = 2, Height = 1, BorderStyle = LineStyle.Single };
454-
view.Border.Thickness = new (1, 1, 1, 0);
454+
view.Border!.Thickness = new (1, 1, 1, 0);
455455
view.BeginInit ();
456456
view.EndInit ();
457457
view.SetRelativeLayout (Application.Screen.Size);
@@ -469,7 +469,7 @@ public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Bottom ()
469469
public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Left ()
470470
{
471471
var view = new View { Width = 1, Height = 2, BorderStyle = LineStyle.Single };
472-
view.Border.Thickness = new (0, 1, 1, 1);
472+
view.Border!.Thickness = new (0, 1, 1, 1);
473473
view.BeginInit ();
474474
view.EndInit ();
475475
view.SetRelativeLayout (Application.Screen.Size);
@@ -494,7 +494,7 @@ public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Left ()
494494
public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Right ()
495495
{
496496
var view = new View { Width = 1, Height = 2, BorderStyle = LineStyle.Single };
497-
view.Border.Thickness = new (1, 1, 0, 1);
497+
view.Border!.Thickness = new (1, 1, 0, 1);
498498
view.BeginInit ();
499499
view.EndInit ();
500500
view.SetRelativeLayout (Application.Screen.Size);
@@ -519,7 +519,7 @@ public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Right ()
519519
public void Draw_Minimum_Full_Border_With_Empty_Viewport_Without_Top ()
520520
{
521521
var view = new View { Width = 2, Height = 1, BorderStyle = LineStyle.Single };
522-
view.Border.Thickness = new (1, 0, 1, 1);
522+
view.Border!.Thickness = new (1, 0, 1, 1);
523523

524524
view.BeginInit ();
525525
view.EndInit ();
@@ -964,7 +964,7 @@ public void SetClip_ClipVisibleContentOnly_VisibleContentIsClipped ()
964964
ViewportSettings = ViewportSettings.ClipContentOnly
965965
};
966966
view.SetContentSize (new Size (10, 10));
967-
view.Border.Thickness = new (1);
967+
view.Border!.Thickness = new (1);
968968
view.BeginInit ();
969969
view.EndInit ();
970970
Assert.Equal (view.Frame, View.GetClip ()!.GetBounds ());
@@ -997,7 +997,7 @@ public void SetClip_Default_ClipsToViewport ()
997997
Height = Dim.Fill ()
998998
};
999999
view.SetContentSize (new Size (10, 10));
1000-
view.Border.Thickness = new (1);
1000+
view.Border!.Thickness = new (1);
10011001
view.BeginInit ();
10021002
view.EndInit ();
10031003
Assert.Equal (view.Frame, View.GetClip ()!.GetBounds ());

0 commit comments

Comments
 (0)