From 216c592265a87678be6dd5ba747eff1663b6d929 Mon Sep 17 00:00:00 2001 From: Edward Miller Date: Thu, 14 Nov 2024 15:54:00 -0600 Subject: [PATCH] fix unit tests --- Maui.DataGrid.Sample/Tests/ColumnsTest.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Maui.DataGrid.Sample/Tests/ColumnsTest.cs b/Maui.DataGrid.Sample/Tests/ColumnsTest.cs index 37c208b..e9e58d7 100644 --- a/Maui.DataGrid.Sample/Tests/ColumnsTest.cs +++ b/Maui.DataGrid.Sample/Tests/ColumnsTest.cs @@ -71,15 +71,10 @@ public async Task SortOrderBindingOnlyWorksWhenLoaded() viewModel.Item = -1; - if (dataGrid.IsLoaded) - { - Assert.Equal(-1, await dataGrid.GetValueSafe(DataGrid.SortedColumnIndexProperty)); - Assert.True(propertyChangedEventTriggered); - } - else - { - Assert.Null(await dataGrid.GetValueSafe(DataGrid.SortedColumnIndexProperty)); - Assert.False(propertyChangedEventTriggered); - } + var sortIndex = (SortData)await dataGrid.GetValueSafe(DataGrid.SortedColumnIndexProperty); + + Assert.Equal(1, sortIndex.Index); + Assert.Equal(SortingOrder.Descendant, sortIndex.Order); + Assert.True(propertyChangedEventTriggered); } }