Browse Source

Fix naming and tests compiler warnings

tznind 1 year ago
parent
commit
0631579bd9
2 changed files with 5 additions and 17 deletions
  1. 5 5
      UICatalog/Scenarios/TextEffectsScenario.cs
  2. 0 12
      UnitTests/Drawing/GradientFillTests.cs

+ 5 - 5
UICatalog/Scenarios/TextEffectsScenario.cs

@@ -12,7 +12,7 @@ namespace UICatalog.Scenarios;
 [ScenarioCategory ("Colors")]
 public class TextEffectsScenario : Scenario
 {
-    private TabView tabView;
+    private TabView _tabView;
 
     public static bool LoopingGradient = false;
 
@@ -48,7 +48,7 @@ public class TextEffectsScenario : Scenario
         };
 
         // Creates a window that occupies the entire terminal with a title.
-        tabView = new TabView ()
+        _tabView = new TabView ()
         {
             Width = Dim.Fill (),
             Height = Dim.Fill (),
@@ -75,14 +75,14 @@ public class TextEffectsScenario : Scenario
         {
             LoopingGradient = e.NewValue == CheckState.Checked;
             SetupGradientLineCanvas (w, w.Frame.Size);
-            tabView.SetNeedsDisplay ();
+            _tabView.SetNeedsDisplay ();
         };
 
         gradientsView.Add (cbLooping);
 
-        tabView.AddTab (t1, false);
+        _tabView.AddTab (t1, false);
 
-        w.Add (tabView);
+        w.Add (_tabView);
 
         Application.Run (w);
         w.Dispose ();

+ 0 - 12
UnitTests/Drawing/GradientFillTests.cs

@@ -37,12 +37,6 @@ public class GradientFillTests
         var bottomLeftColor = gradientFill.GetColor (bottomLeft);
         var bottomRightColor = gradientFill.GetColor (bottomRight);
 
-        // Validate the colors at the corners
-        Assert.NotNull (topLeftColor);
-        Assert.NotNull (topRightColor);
-        Assert.NotNull (bottomLeftColor);
-        Assert.NotNull (bottomRightColor);
-
         // Expected colors
         var expectedTopLeftColor = new Terminal.Gui.Color (255, 0, 0); // Red
         var expectedBottomRightColor = new Terminal.Gui.Color (0, 0, 255); // Blue
@@ -73,9 +67,6 @@ public class GradientFillTests
                 var point = new Point (col, row);
                 var color = gradientFill.GetColor (point);
 
-                // Ensure color is not null
-                Assert.NotNull (color);
-
                 // Check if the current color is 'more blue' and 'less red' as it goes right and down
                 Assert.True (color.R <= previousRed, $"Failed at ({col}, {row}): {color.R} > {previousRed}");
                 Assert.True (color.B >= previousBlue, $"Failed at ({col}, {row}): {color.B} < {previousBlue}");
@@ -96,9 +87,6 @@ public class GradientFillTests
                 var point = new Point (col, row);
                 var color = gradientFill.GetColor (point);
 
-                // Ensure color is not null
-                Assert.NotNull (color);
-
                 // Check if the current color is 'more blue' and 'less red' as it goes right and down
                 Assert.True (color.R <= previousRed, $"Failed at ({col}, {row}): {color.R} > {previousRed}");
                 Assert.True (color.B >= previousBlue, $"Failed at ({col}, {row}): {color.B} < {previousBlue}");