From 4094a290eb1a4016cdded75f725e0f5fde2721a1 Mon Sep 17 00:00:00 2001 From: Bj Tecu Date: Tue, 30 Jan 2024 23:40:01 -0500 Subject: [PATCH 1/3] Cleanup asserts --- .../Query/AdHocJsonQueryTestBase.cs | 8 +-- .../TwoDatabasesTestBase.cs | 1 - .../Update/JsonUpdateTestBase.cs | 50 +++++++++---------- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/test/EFCore.Relational.Specification.Tests/Query/AdHocJsonQueryTestBase.cs b/test/EFCore.Relational.Specification.Tests/Query/AdHocJsonQueryTestBase.cs index 755a97760fd..09d68ff9cf2 100644 --- a/test/EFCore.Relational.Specification.Tests/Query/AdHocJsonQueryTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/Query/AdHocJsonQueryTestBase.cs @@ -85,8 +85,8 @@ public virtual async Task Optional_json_properties_materialized_as_null_when_the : query.Single(); Assert.Equal(3, result.Id); - Assert.Equal(null, result.Reference.NullableScalar); - Assert.Equal(null, result.Collection[0].NullableScalar); + Assert.Null(result.Reference.NullableScalar); + Assert.Null(result.Collection[0].NullableScalar); } } @@ -107,8 +107,8 @@ public virtual async Task Can_project_nullable_json_property_when_the_element_in Assert.Equal(3, result.Count); Assert.Equal(11, result[0]); - Assert.Equal(null, result[1]); - Assert.Equal(null, result[2]); + Assert.Null(result[1]); + Assert.Null(result[2]); } } diff --git a/test/EFCore.Relational.Specification.Tests/TwoDatabasesTestBase.cs b/test/EFCore.Relational.Specification.Tests/TwoDatabasesTestBase.cs index 1f2abffbfec..ad281627b00 100644 --- a/test/EFCore.Relational.Specification.Tests/TwoDatabasesTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/TwoDatabasesTestBase.cs @@ -75,7 +75,6 @@ public virtual void Can_query_from_one_connection_and_save_changes_to_another() [ConditionalTheory] [InlineData(true, false)] - [InlineData(true, false)] [InlineData(true, true)] public virtual void Can_set_connection_string_in_interceptor(bool withConnectionString, bool withNullConnectionString) { diff --git a/test/EFCore.Relational.Specification.Tests/Update/JsonUpdateTestBase.cs b/test/EFCore.Relational.Specification.Tests/Update/JsonUpdateTestBase.cs index 565d455ecd5..c1968f71ba5 100644 --- a/test/EFCore.Relational.Specification.Tests/Update/JsonUpdateTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/Update/JsonUpdateTestBase.cs @@ -772,8 +772,8 @@ public virtual Task Edit_single_property_bool() async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(false, result.Reference.TestBoolean); - Assert.Equal(true, result.Collection[0].TestBoolean); + Assert.False(result.Reference.TestBoolean); + Assert.True(result.Collection[0].TestBoolean); }); [ConditionalFact] @@ -1217,8 +1217,8 @@ public virtual Task Edit_single_property_nullable_int32_set_to_null() async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableInt32); - Assert.Equal(null, result.Collection[0].TestNullableInt32); + Assert.Null(result.Reference.TestNullableInt32); + Assert.Null(result.Collection[0].TestNullableInt32); }); [ConditionalFact] @@ -1305,8 +1305,8 @@ public virtual Task Edit_single_property_nullable_enum_set_to_null() async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableEnum); - Assert.Equal(null, result.Collection[0].TestNullableEnum); + Assert.Null(result.Reference.TestNullableEnum); + Assert.Null(result.Collection[0].TestNullableEnum); }); [ConditionalFact] @@ -1349,8 +1349,8 @@ public virtual Task Edit_single_property_nullable_enum_with_int_converter_set_to async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableEnumWithIntConverter); - Assert.Equal(null, result.Collection[0].TestNullableEnumWithIntConverter); + Assert.Null(result.Reference.TestNullableEnumWithIntConverter); + Assert.Null(result.Collection[0].TestNullableEnumWithIntConverter); }); [ConditionalFact] @@ -1393,8 +1393,8 @@ public virtual Task Edit_single_property_nullable_enum_with_converter_that_handl async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableEnumWithConverterThatHandlesNulls); - Assert.Equal(null, result.Collection[0].TestNullableEnumWithConverterThatHandlesNulls); + Assert.Null(result.Reference.TestNullableEnumWithConverterThatHandlesNulls); + Assert.Null(result.Collection[0].TestNullableEnumWithConverterThatHandlesNulls); }); [ConditionalFact] @@ -1522,7 +1522,7 @@ public virtual Task Edit_single_property_with_converter_bool_to_int_zero_one() async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(false, result.Reference.BoolConvertedToIntZeroOne); + Assert.False(result.Reference.BoolConvertedToIntZeroOne); }); [ConditionalFact] @@ -1542,7 +1542,7 @@ public virtual Task Edit_single_property_with_converter_bool_to_string_True_Fals async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(true, result.Reference.BoolConvertedToStringTrueFalse); + Assert.True(result.Reference.BoolConvertedToStringTrueFalse); }); [ConditionalFact] @@ -1562,7 +1562,7 @@ public virtual Task Edit_single_property_with_converter_bool_to_string_Y_N() async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(false, result.Reference.BoolConvertedToStringYN); + Assert.False(result.Reference.BoolConvertedToStringYN); }); [ConditionalFact] @@ -2227,8 +2227,8 @@ public virtual Task Edit_single_property_collection_of_nullable_int32_set_to_nul async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableInt32Collection); - Assert.Equal(null, result.Collection[0].TestNullableInt32Collection); + Assert.Null(result.Reference.TestNullableInt32Collection); + Assert.Null(result.Collection[0].TestNullableInt32Collection); Assert.True(result.Reference.NewCollectionSet); // Set to null. Assert.True(result.Collection[0].NewCollectionSet); // Set to null. @@ -2327,8 +2327,8 @@ public virtual Task Edit_single_property_collection_of_nullable_enum_set_to_null async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableEnumCollection); - Assert.Equal(null, result.Collection[0].TestNullableEnumCollection); + Assert.Null(result.Reference.TestNullableEnumCollection); + Assert.Null(result.Collection[0].TestNullableEnumCollection); Assert.True(result.Reference.NewCollectionSet); // Set to null. Assert.True(result.Collection[0].NewCollectionSet); // Set to null. @@ -2383,8 +2383,8 @@ public virtual Task Edit_single_property_collection_of_nullable_enum_with_int_co async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableEnumWithIntConverterCollection); - Assert.Equal(null, result.Collection[0].TestNullableEnumWithIntConverterCollection); + Assert.Null(result.Reference.TestNullableEnumWithIntConverterCollection); + Assert.Null(result.Collection[0].TestNullableEnumWithIntConverterCollection); Assert.True(result.Reference.NewCollectionSet); // Set to null. Assert.True(result.Collection[0].NewCollectionSet); // Set to null. @@ -2434,8 +2434,8 @@ public virtual Task Edit_single_property_collection_of_nullable_enum_with_conver async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.Reference.TestNullableEnumWithConverterThatHandlesNullsCollection); - Assert.Equal(null, result.Collection[0].TestNullableEnumWithConverterThatHandlesNullsCollection); + Assert.Null(result.Reference.TestNullableEnumWithConverterThatHandlesNullsCollection); + Assert.Null(result.Collection[0].TestNullableEnumWithConverterThatHandlesNullsCollection); Assert.False(result.Reference.NewCollectionSet); Assert.False(result.Collection[0].NewCollectionSet); @@ -2878,7 +2878,7 @@ public virtual Task Edit_single_property_relational_collection_of_nullable_int32 async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.TestNullableInt32Collection); + Assert.Null(result.TestNullableInt32Collection); Assert.True(result.NewCollectionSet); // Set to null. }); @@ -2966,7 +2966,7 @@ public virtual Task Edit_single_property_relational_collection_of_nullable_enum_ async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.TestNullableEnumCollection); + Assert.Null(result.TestNullableEnumCollection); Assert.True(result.NewCollectionSet); // Set to null. }); @@ -3013,7 +3013,7 @@ public virtual Task Edit_single_property_relational_collection_of_nullable_enum_ async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.TestNullableEnumWithIntConverterCollection); + Assert.Null(result.TestNullableEnumWithIntConverterCollection); Assert.True(result.NewCollectionSet); // Set to null. }); @@ -3057,7 +3057,7 @@ public virtual Task Edit_single_property_relational_collection_of_nullable_enum_ async context => { var result = await context.Set().SingleAsync(x => x.Id == 1); - Assert.Equal(null, result.TestNullableEnumWithConverterThatHandlesNullsCollection); + Assert.Null(result.TestNullableEnumWithConverterThatHandlesNullsCollection); Assert.False(result.NewCollectionSet); }); From 634f2afed8970beb43d3c1eaeb708125a4f827d5 Mon Sep 17 00:00:00 2001 From: Bj Tecu Date: Wed, 31 Jan 2024 17:56:18 -0500 Subject: [PATCH 2/3] Assert.True --- .../Internal/CSharpDbContextGeneratorTest.cs | 2 +- .../Migrations/MigrationsSqlServerTest.cs | 2 +- .../ChangeTracking/PropertyEntryTest.cs | 32 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpDbContextGeneratorTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpDbContextGeneratorTest.cs index e4c63e78f8e..4b51e3ddbf6 100644 --- a/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpDbContextGeneratorTest.cs +++ b/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpDbContextGeneratorTest.cs @@ -968,7 +968,7 @@ public Task Is_fixed_length_annotation_should_be_scaffolded_without_optional_par new ModelCodeGenerationOptions { UseDataAnnotations = false }, code => Assert.Contains(".IsFixedLength()", code.ContextFile.Code), model => - Assert.Equal(true, model.FindEntityType("TestNamespace.Employee").GetProperty("Name").IsFixedLength())); + Assert.True(model.FindEntityType("TestNamespace.Employee").GetProperty("Name").IsFixedLength())); [ConditionalFact] public Task Global_namespace_works() diff --git a/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs index 4a30e2fa155..b0cc04158d8 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs @@ -3479,7 +3479,7 @@ await Test( { var table = Assert.Single(model.Tables); Assert.Equal("Customer", table.Name); - Assert.Equal(true, table[SqlServerAnnotationNames.IsTemporal]); + Assert.True(true, table[SqlServerAnnotationNames.IsTemporal]); Assert.Equal("CustomerHistory", table[SqlServerAnnotationNames.TemporalHistoryTableName]); Assert.Equal("SystemTimeStart", table[SqlServerAnnotationNames.TemporalPeriodStartPropertyName]); Assert.Equal("SystemTimeEnd", table[SqlServerAnnotationNames.TemporalPeriodEndPropertyName]); diff --git a/test/EFCore.Tests/ChangeTracking/PropertyEntryTest.cs b/test/EFCore.Tests/ChangeTracking/PropertyEntryTest.cs index 1ea5353f82f..9deb211b505 100644 --- a/test/EFCore.Tests/ChangeTracking/PropertyEntryTest.cs +++ b/test/EFCore.Tests/ChangeTracking/PropertyEntryTest.cs @@ -1491,7 +1491,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, cultureEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", cultureEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", cultureEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, cultureEntry.Property(e => e.Validation).CurrentValue); + Assert.True(cultureEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.Culture.Manufacturer, cultureManufacturerEntry.CurrentValue); Assert.Equal("Nom", cultureManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, cultureManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1532,7 +1532,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, milkEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", milkEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", milkEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, milkEntry.Property(e => e.Validation).CurrentValue); + Assert.True(milkEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.Milk.Manufacturer, milkManufacturerEntry.CurrentValue); Assert.Equal("Nom", milkManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, milkManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1573,7 +1573,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, fieldCultureEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", fieldCultureEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", fieldCultureEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, fieldCultureEntry.Property(e => e.Validation).CurrentValue); + Assert.True(fieldCultureEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.FieldCulture.Manufacturer, fieldCultureManufacturerEntry.CurrentValue); Assert.Equal("Nom", fieldCultureManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, fieldCultureManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1614,7 +1614,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, fieldMilkEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", fieldMilkEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", fieldMilkEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, fieldMilkEntry.Property(e => e.Validation).CurrentValue); + Assert.True(fieldMilkEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.FieldMilk.Manufacturer, fieldMilkManufacturerEntry.CurrentValue); Assert.Equal("Nom", fieldMilkManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, fieldMilkManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1636,7 +1636,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, cultureEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", cultureEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", cultureEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, cultureEntry.Property(e => e.Validation).CurrentValue); + Assert.True(cultureEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.Culture.Manufacturer, cultureManufacturerEntry.CurrentValue); Assert.Equal("Nom", cultureManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, cultureManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1656,7 +1656,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, milkEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", milkEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", milkEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, milkEntry.Property(e => e.Validation).CurrentValue); + Assert.True(milkEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.Milk.Manufacturer, milkManufacturerEntry.CurrentValue); Assert.Equal("Nom", milkManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, milkManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1676,7 +1676,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, fieldCultureEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", fieldCultureEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", fieldCultureEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, fieldCultureEntry.Property(e => e.Validation).CurrentValue); + Assert.True(fieldCultureEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.FieldCulture.Manufacturer, fieldCultureManufacturerEntry.CurrentValue); Assert.Equal("Nom", fieldCultureManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, fieldCultureManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -1696,7 +1696,7 @@ public void Can_set_current_value_for_complex_property() Assert.Equal(11, fieldMilkEntry.Property(e => e.Rating).CurrentValue); Assert.Equal("XY", fieldMilkEntry.Property(e => e.Species).CurrentValue); Assert.Equal("Z", fieldMilkEntry.Property(e => e.Subspecies).CurrentValue); - Assert.Equal(true, fieldMilkEntry.Property(e => e.Validation).CurrentValue); + Assert.True(fieldMilkEntry.Property(e => e.Validation).CurrentValue); Assert.Equal(yogurt.FieldMilk.Manufacturer, fieldMilkManufacturerEntry.CurrentValue); Assert.Equal("Nom", fieldMilkManufacturerEntry.Property(e => e.Name).CurrentValue); Assert.Equal(9, fieldMilkManufacturerEntry.Property(e => e.Rating).CurrentValue); @@ -2681,7 +2681,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, cultureEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", cultureEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", cultureEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, cultureEntry.Property(e => e.Validation).OriginalValue); + Assert.True(cultureEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", cultureManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, cultureManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", cultureManTogEntry.Property(e => e.Text).OriginalValue); @@ -2741,7 +2741,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, milkEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", milkEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", milkEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, milkEntry.Property(e => e.Validation).OriginalValue); + Assert.True(milkEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", milkManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, milkManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", milkManTogEntry.Property(e => e.Text).OriginalValue); @@ -2801,7 +2801,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, fieldCultureEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", fieldCultureEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", fieldCultureEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, fieldCultureEntry.Property(e => e.Validation).OriginalValue); + Assert.True(fieldCultureEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", fieldCultureManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, fieldCultureManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", fieldCultureManTogEntry.Property(e => e.Text).OriginalValue); @@ -2861,7 +2861,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, fieldMilkEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", fieldMilkEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", fieldMilkEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, fieldMilkEntry.Property(e => e.Validation).OriginalValue); + Assert.True(fieldMilkEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", fieldMilkManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, fieldMilkManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", fieldMilkManTogEntry.Property(e => e.Text).OriginalValue); @@ -2889,7 +2889,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, cultureEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", cultureEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", cultureEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, cultureEntry.Property(e => e.Validation).OriginalValue); + Assert.True(cultureEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", cultureManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, cultureManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", cultureManTogEntry.Property(e => e.Text).OriginalValue); @@ -2915,7 +2915,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, milkEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", milkEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", milkEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, milkEntry.Property(e => e.Validation).OriginalValue); + Assert.True(milkEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", milkManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, milkManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", milkManTogEntry.Property(e => e.Text).OriginalValue); @@ -2941,7 +2941,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, fieldCultureEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", fieldCultureEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", fieldCultureEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, fieldCultureEntry.Property(e => e.Validation).OriginalValue); + Assert.True(fieldCultureEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", fieldCultureManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, fieldCultureManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", fieldCultureManTogEntry.Property(e => e.Text).OriginalValue); @@ -2967,7 +2967,7 @@ public void Can_set_and_get_original_value_for_complex_property() Assert.Equal(11, fieldMilkEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("XY", fieldMilkEntry.Property(e => e.Species).OriginalValue); Assert.Equal("Z", fieldMilkEntry.Property(e => e.Subspecies).OriginalValue); - Assert.Equal(true, fieldMilkEntry.Property(e => e.Validation).OriginalValue); + Assert.True(fieldMilkEntry.Property(e => e.Validation).OriginalValue); Assert.Equal("Nom", fieldMilkManufacturerEntry.Property(e => e.Name).OriginalValue); Assert.Equal(9, fieldMilkManufacturerEntry.Property(e => e.Rating).OriginalValue); Assert.Equal("Tog1", fieldMilkManTogEntry.Property(e => e.Text).OriginalValue); From 386f22dbed7970416d854a839082e0a856be4401 Mon Sep 17 00:00:00 2001 From: maumar Date: Fri, 2 Feb 2024 14:47:50 -0800 Subject: [PATCH 3/3] fixing compilation error --- .../Migrations/MigrationsSqlServerTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs index b0cc04158d8..4a30e2fa155 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs @@ -3479,7 +3479,7 @@ await Test( { var table = Assert.Single(model.Tables); Assert.Equal("Customer", table.Name); - Assert.True(true, table[SqlServerAnnotationNames.IsTemporal]); + Assert.Equal(true, table[SqlServerAnnotationNames.IsTemporal]); Assert.Equal("CustomerHistory", table[SqlServerAnnotationNames.TemporalHistoryTableName]); Assert.Equal("SystemTimeStart", table[SqlServerAnnotationNames.TemporalPeriodStartPropertyName]); Assert.Equal("SystemTimeEnd", table[SqlServerAnnotationNames.TemporalPeriodEndPropertyName]);