From 9170f759500e36328f4d95e3999a7a5d87cf3a8f Mon Sep 17 00:00:00 2001 From: Edward Miller Date: Wed, 17 Apr 2024 21:19:43 -0500 Subject: [PATCH] fix nullability warnings --- Maui.DataGrid.Sample/Tests/PropertyTest.cs | 1 + Maui.DataGrid.Sample/Tests/TestUtils/TestExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Maui.DataGrid.Sample/Tests/PropertyTest.cs b/Maui.DataGrid.Sample/Tests/PropertyTest.cs index 088a4d9..7ed7deb 100644 --- a/Maui.DataGrid.Sample/Tests/PropertyTest.cs +++ b/Maui.DataGrid.Sample/Tests/PropertyTest.cs @@ -45,6 +45,7 @@ public void TestPropertiesSetsProperly() private void Command2() { } internal static void TestProperty(BindableProperty property, T testValue, T updatedValue) + where T : notnull { var dataGrid = new DataGrid(); dataGrid.CheckPropertyBindingWorks(property, testValue, updatedValue); diff --git a/Maui.DataGrid.Sample/Tests/TestUtils/TestExtensions.cs b/Maui.DataGrid.Sample/Tests/TestUtils/TestExtensions.cs index 7d5a514..f72976d 100644 --- a/Maui.DataGrid.Sample/Tests/TestUtils/TestExtensions.cs +++ b/Maui.DataGrid.Sample/Tests/TestUtils/TestExtensions.cs @@ -15,7 +15,7 @@ public static async Task GetValueSafe(this BindableObject bindableObject return bindableObject.GetValue(property); } - public static async void CheckPropertyBindingWorks(this BindableObject bindableObject, BindableProperty property, T testValue, T updatedValue) + public static async void CheckPropertyBindingWorks(this BindableObject bindableObject, BindableProperty property, T testValue, T? updatedValue) where T : notnull { Assert.Equal(property.DefaultValue, await bindableObject.GetValueSafe(property));