From a85c5c68d157c629c7d6ba90b61e997dd698b97a Mon Sep 17 00:00:00 2001 From: Osama Al-Rashed Date: Sat, 2 Nov 2024 14:48:07 +0400 Subject: [PATCH] Fix All the tests --- Gridazor.Tests/IntegrationTests/GridEditorForTests.cs | 6 +++--- Gridazor.Tests/UnitTests/DefaultColumnProviderTests.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gridazor.Tests/IntegrationTests/GridEditorForTests.cs b/Gridazor.Tests/IntegrationTests/GridEditorForTests.cs index 33ab501..1a93f81 100644 --- a/Gridazor.Tests/IntegrationTests/GridEditorForTests.cs +++ b/Gridazor.Tests/IntegrationTests/GridEditorForTests.cs @@ -135,13 +135,13 @@ public void GridEditorFor_WithNonEnumerableType_ThrowsArgumentException() public class TestModel { - public IEnumerable Items { get; set; } - public string NonEnumerableProperty { get; set; } + public required IEnumerable Items { get; set; } + public string NonEnumerableProperty { get; set; } = null!; } public class TestItem { - public string Name { get; set; } + public required string Name { get; set; } public int Value { get; set; } } } diff --git a/Gridazor.Tests/UnitTests/DefaultColumnProviderTests.cs b/Gridazor.Tests/UnitTests/DefaultColumnProviderTests.cs index 98eeb79..5678e65 100644 --- a/Gridazor.Tests/UnitTests/DefaultColumnProviderTests.cs +++ b/Gridazor.Tests/UnitTests/DefaultColumnProviderTests.cs @@ -16,7 +16,7 @@ private class TestClass [Required(true)] [Hide] [RowSelection] - public string TestProperty { get; set; } + public required string TestProperty { get; set; } public int AnotherProperty { get; set; } @@ -43,7 +43,7 @@ public void Get_ShouldReturnColumnsWithAttributes() var firstColumn = columns.FirstOrDefault(c => c.Field == "customField"); firstColumn.Should().NotBeNull(); - firstColumn.HeaderName.Should().Be("Custom Header"); + firstColumn!.HeaderName.Should().Be("Custom Header"); firstColumn.Field.Should().Be("customField"); firstColumn.Editable.Should().BeFalse(); firstColumn.CellDataType.Should().Be("string"); @@ -54,7 +54,7 @@ public void Get_ShouldReturnColumnsWithAttributes() var secondColumn = columns.FirstOrDefault(c => c.Field == "anotherProperty"); secondColumn.Should().NotBeNull(); - secondColumn.HeaderName.Should().Be("AnotherProperty"); + secondColumn!.HeaderName.Should().Be("AnotherProperty"); secondColumn.Field.Should().Be("anotherProperty"); secondColumn.Editable.Should().BeTrue(); secondColumn.CellDataType.Should().Be("number"); @@ -65,11 +65,11 @@ public void Get_ShouldReturnColumnsWithAttributes() var thirdColumn = columns.FirstOrDefault(c => c.Field == "dateProperty"); thirdColumn.Should().NotBeNull(); - thirdColumn.HeaderName.Should().Be("DateProperty"); + thirdColumn!.HeaderName.Should().Be("DateProperty"); thirdColumn.Field.Should().Be("dateProperty"); thirdColumn.Editable.Should().BeTrue(); thirdColumn.CellDataType.Should().Be("dateString"); - thirdColumn.CellEditor.Should().BeEmpty(); + thirdColumn.CellEditor.Should().Be("agDateStringCellEditor"); thirdColumn.Required.Should().BeTrue(); thirdColumn.Hide.Should().BeFalse(); thirdColumn.IsRowSelectable.Should().BeFalse();