diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 301f6eca0de..f98a5b581e9 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -56,17 +56,17 @@
-
+
https://github.com/dotnet/arcade
- 1d451c32dda2314c721adbf8829e1c0cd4e681ff
+ 822f095b8c815dd7b9161140a9ff8151de593f82
-
+
https://github.com/dotnet/arcade
- 1d451c32dda2314c721adbf8829e1c0cd4e681ff
+ 822f095b8c815dd7b9161140a9ff8151de593f82
-
+
https://github.com/dotnet/arcade
- 1d451c32dda2314c721adbf8829e1c0cd4e681ff
+ 822f095b8c815dd7b9161140a9ff8151de593f82
diff --git a/eng/Versions.props b/eng/Versions.props
index 831d422e6c9..89c1914bf39 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -31,7 +31,7 @@
9.0.0-alpha.1.23511.18
- 8.0.0-beta.23463.1
+ 9.0.0-beta.23508.1
diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1
index 6c4ac6fec1a..91f8196cc80 100644
--- a/eng/common/sdk-task.ps1
+++ b/eng/common/sdk-task.ps1
@@ -64,7 +64,7 @@ try {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
- $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.6.0-2" -MemberType NoteProperty
+ $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.7.2-1" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index aa74ab4a81e..84cfe7cd9cb 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -379,13 +379,13 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
}
# Minimum VS version to require.
- $vsMinVersionReqdStr = '17.6'
+ $vsMinVersionReqdStr = '17.7'
$vsMinVersionReqd = [Version]::new($vsMinVersionReqdStr)
# If the version of msbuild is going to be xcopied,
# use this version. Version matches a package here:
- # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/RoslynTools.MSBuild/versions/17.6.0-2
- $defaultXCopyMSBuildVersion = '17.6.0-2'
+ # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/RoslynTools.MSBuild/versions/17.7.2-1
+ $defaultXCopyMSBuildVersion = '17.7.2-1'
if (!$vsRequirements) {
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
diff --git a/global.json b/global.json
index ab2a8d570c5..cd6375530b4 100644
--- a/global.json
+++ b/global.json
@@ -13,7 +13,7 @@
}
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23463.1",
- "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23463.1"
+ "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23508.1",
+ "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23508.1"
}
}
diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindKeylessEntitiesQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindKeylessEntitiesQueryCosmosTest.cs
index cf7fe195344..3fa71cb5836 100644
--- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindKeylessEntitiesQueryCosmosTest.cs
+++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindKeylessEntitiesQueryCosmosTest.cs
@@ -48,10 +48,8 @@ FROM root c
public override async Task KeylessEntity_by_database_view(bool async)
{
// Views are not supported.
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(
- () => base.KeylessEntity_by_database_view(async))).Actual);
+ await Assert.ThrowsAsync(
+ () => base.KeylessEntity_by_database_view(async));
AssertSql(
"""
@@ -70,10 +68,9 @@ public override async Task Entity_mapped_to_view_on_right_side_of_join(bool asyn
public override async Task KeylessEntity_with_nav_defining_query(bool async)
{
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(
- () => base.KeylessEntity_with_nav_defining_query(async))).Actual);
+ // Defining queries are not supported.
+ await Assert.ThrowsAsync(
+ () => base.KeylessEntity_with_nav_defining_query(async));
AssertSql(
"""
diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs
index b01c89705b4..430a827346d 100644
--- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs
+++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs
@@ -1993,9 +1993,7 @@ ORDER BY c["CustomerID"]
public override async Task Where_bitwise_or_with_logical_or(bool async)
{
// Bitwise operators on booleans. Issue #13168.
- Assert.Equal(
- "1",
- (await Assert.ThrowsAsync(() => base.Where_bitwise_or_with_logical_or(async))).Actual);
+ await Assert.ThrowsAsync(() => base.Where_bitwise_or_with_logical_or(async));
AssertSql(
"""
@@ -2020,9 +2018,7 @@ FROM root c
public override async Task Where_bitwise_or_with_logical_and(bool async)
{
// Bitwise operators on booleans. Issue #13168.
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(() => base.Where_bitwise_or_with_logical_and(async))).Actual);
+ await Assert.ThrowsAsync(() => base.Where_bitwise_or_with_logical_and(async));
AssertSql(
"""
diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindWhereQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindWhereQueryCosmosTest.cs
index c5a4a84062b..10ce709579e 100644
--- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindWhereQueryCosmosTest.cs
+++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindWhereQueryCosmosTest.cs
@@ -105,9 +105,7 @@ FROM root c
public override async Task Where_bitwise_or(bool async)
{
// Bitwise operators on booleans. Issue #13168.
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(() => base.Where_bitwise_or(async))).Actual);
+ await Assert.ThrowsAsync(() => base.Where_bitwise_or(async));
AssertSql(
"""
@@ -800,9 +798,7 @@ FROM root c
public override async Task Where_simple_shadow_subquery(bool async)
{
- Assert.Equal(
- "5",
- (await Assert.ThrowsAsync(() => base.Where_simple_shadow_subquery(async))).Actual);
+ await Assert.ThrowsAsync(() => base.Where_simple_shadow_subquery(async));
AssertSql(
"""
diff --git a/test/EFCore.Cosmos.Tests/ModelBuilding/CosmosModelBuilderGenericTest.cs b/test/EFCore.Cosmos.Tests/ModelBuilding/CosmosModelBuilderGenericTest.cs
index a528c3d2df6..48c428d3bd8 100644
--- a/test/EFCore.Cosmos.Tests/ModelBuilding/CosmosModelBuilderGenericTest.cs
+++ b/test/EFCore.Cosmos.Tests/ModelBuilding/CosmosModelBuilderGenericTest.cs
@@ -1007,16 +1007,14 @@ public class CosmosGenericOwnedTypes : GenericOwnedTypes
public override void Deriving_from_owned_type_throws()
// On Cosmos the base type starts as owned
=> Assert.Contains(
- "(No exception was thrown)",
- Assert.Throws(
- () => base.Deriving_from_owned_type_throws()).Message);
+ "No exception was thrown",
+ Assert.Throws(base.Deriving_from_owned_type_throws).Message);
public override void Configuring_base_type_as_owned_throws()
// On Cosmos the base type starts as owned
=> Assert.Contains(
- "(No exception was thrown)",
- Assert.Throws(
- () => base.Deriving_from_owned_type_throws()).Message);
+ "No exception was thrown",
+ Assert.Throws(base.Deriving_from_owned_type_throws).Message);
[ConditionalFact]
public virtual void Reference_type_is_discovered_as_owned()
diff --git a/test/EFCore.Design.Tests/Migrations/Design/CSharpMigrationsGeneratorTest.cs b/test/EFCore.Design.Tests/Migrations/Design/CSharpMigrationsGeneratorTest.cs
index 58e161ecff2..7cffb61282d 100644
--- a/test/EFCore.Design.Tests/Migrations/Design/CSharpMigrationsGeneratorTest.cs
+++ b/test/EFCore.Design.Tests/Migrations/Design/CSharpMigrationsGeneratorTest.cs
@@ -393,7 +393,7 @@ private static void MissingAnnotationCheck(
}
catch (Exception e)
{
- Assert.False(true, $"Annotation '{annotationName}' was not handled by the code generator: {e.Message}");
+ Assert.Fail($"Annotation '{annotationName}' was not handled by the code generator: {e.Message}");
}
try
diff --git a/test/EFCore.InMemory.FunctionalTests/Query/GearsOfWarQueryInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Query/GearsOfWarQueryInMemoryTest.cs
index 8c1c21a1f66..8639f6c7bf3 100644
--- a/test/EFCore.InMemory.FunctionalTests/Query/GearsOfWarQueryInMemoryTest.cs
+++ b/test/EFCore.InMemory.FunctionalTests/Query/GearsOfWarQueryInMemoryTest.cs
@@ -99,19 +99,12 @@ public override Task Include_after_SelectMany_throws(bool async)
=> Assert.ThrowsAsync(() => base.Include_after_SelectMany_throws(async));
public override async Task Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result4(bool async)
- => Assert.Equal(
- "4",
- (((EqualException)(await Assert.ThrowsAsync(
- () => base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result4(async))).InnerException!.InnerException)!)
- .Actual);
+ => await Assert.ThrowsAsync(
+ () => base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result4(async));
public override async Task Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_complex_projection_result(bool async)
- => Assert.Equal(
- "6",
- (((EqualException)(await Assert.ThrowsAsync(
- () => base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_complex_projection_result(async)))
- .InnerException!.InnerException)!)
- .Actual);
+ => await Assert.ThrowsAsync(
+ () => base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_complex_projection_result(async));
public override Task Null_semantics_is_correctly_applied_for_function_comparisons_that_take_arguments_from_optional_navigation(
bool async)
diff --git a/test/EFCore.InMemory.FunctionalTests/Query/NorthwindSelectQueryInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Query/NorthwindSelectQueryInMemoryTest.cs
index e92473fb602..f5e968ad63e 100644
--- a/test/EFCore.InMemory.FunctionalTests/Query/NorthwindSelectQueryInMemoryTest.cs
+++ b/test/EFCore.InMemory.FunctionalTests/Query/NorthwindSelectQueryInMemoryTest.cs
@@ -26,7 +26,5 @@ public override Task
public override async Task SelectMany_correlated_with_outer_3(bool async)
// DefaultIfEmpty. Issue #17536.
- => Assert.Equal(
- "Madrid",
- (await Assert.ThrowsAsync(() => base.SelectMany_correlated_with_outer_3(async))).Actual);
+ => await Assert.ThrowsAsync(() => base.SelectMany_correlated_with_outer_3(async));
}
diff --git a/test/EFCore.NativeAotTests/CompiledModels/UserEntityType.cs b/test/EFCore.NativeAotTests/CompiledModels/UserEntityType.cs
index 6b8691cc4e1..3e9741c585c 100644
--- a/test/EFCore.NativeAotTests/CompiledModels/UserEntityType.cs
+++ b/test/EFCore.NativeAotTests/CompiledModels/UserEntityType.cs
@@ -33,7 +33,6 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType? ba
providerValueComparer: ValueComparer.CreateDefault(favorStructuralComparisons: true),
sentinel: 0);
id.SetSetter((User e, int v) => e.Id = v);
- id.SetGetter((User e) => e.Id, e => e.Id == default(int));
id.SetAccessors(new PropertyAccessors(
(InternalEntityEntry e) =>
((User)e.Entity).Id == 0
@@ -63,7 +62,6 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType? ba
valueComparer: ValueComparer.CreateDefault(favorStructuralComparisons: false),
providerValueComparer: ValueComparer.CreateDefault(favorStructuralComparisons: true));
name.SetSetter((User e, string v) => e.Name = v);
- name.SetGetter((User e) => e.Name, e => e.Name == default(string));
name.SetAccessors(new PropertyAccessors(
(InternalEntityEntry e) => ((User)e.Entity).Name,
(InternalEntityEntry e) => ((User)e.Entity).Name,
diff --git a/test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs b/test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs
index b6c5537c91a..8f5bb41877b 100644
--- a/test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs
+++ b/test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs
@@ -894,7 +894,7 @@ public virtual async Task Include_does_not_close_user_opened_connection_for_empt
? await query.ToArrayAsync()
: query.ToArray();
- Assert.Empty(query);
+ Assert.False(query.Any());
Assert.Equal(ConnectionState.Open, connection.State);
context.Database.CloseConnection();
diff --git a/test/EFCore.Relational.Tests/Infrastructure/RelationalModelValidatorTest.cs b/test/EFCore.Relational.Tests/Infrastructure/RelationalModelValidatorTest.cs
index 2619bb2e72a..63b3a1c0531 100644
--- a/test/EFCore.Relational.Tests/Infrastructure/RelationalModelValidatorTest.cs
+++ b/test/EFCore.Relational.Tests/Infrastructure/RelationalModelValidatorTest.cs
@@ -1392,7 +1392,7 @@ public virtual void Detects_duplicate_foreignKey_names_within_hierarchy_on_diffe
// Should throw. Issue #23144.
Assert.Contains(
- "(No exception was thrown)",
+ "No exception was thrown",
Assert.Throws(
() => VerifyError(
RelationalStrings.DuplicateForeignKeyTableMismatch(
diff --git a/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs b/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs
index d0453ce9ed2..678876b5e1f 100644
--- a/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs
+++ b/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs
@@ -862,10 +862,8 @@ public void BatchCommands_creates_batch_on_incomplete_updates_for_shared_table_n
Assert.Equal(EntityState.Modified, command.EntityState);
// Detect indirect update dependencies. Issue #17947.
- Assert.Equal(
- "4",
- Assert.Throws(
- () => Assert.Equal(5, command.ColumnModifications.Count)).Actual);
+ Assert.Throws(
+ () => Assert.Equal(5, command.ColumnModifications.Count));
}
// var columnMod = command.ColumnModifications[0];
@@ -956,10 +954,8 @@ public void BatchCommands_creates_batch_on_incomplete_updates_for_shared_table_n
if (state == EntityState.Deleted)
{
// Detect indirect update dependencies. Issue #17947.
- Assert.Equal(
- "1",
- Assert.Throws(
- () => Assert.Equal(2, commandBatches.Count)).Actual);
+ Assert.Throws(
+ () => Assert.Equal(2, commandBatches.Count));
}
else
{
diff --git a/test/EFCore.Specification.Tests/InterceptionTestBase.cs b/test/EFCore.Specification.Tests/InterceptionTestBase.cs
index 9760f80eb47..47f2656a3dd 100644
--- a/test/EFCore.Specification.Tests/InterceptionTestBase.cs
+++ b/test/EFCore.Specification.Tests/InterceptionTestBase.cs
@@ -126,12 +126,12 @@ public void AssertEventsInOrder(params string[] eventNames)
if (indexFound < 0)
{
- Assert.True(false, $"Event {eventNames[i]} not found.");
+ Assert.Fail($"Event {eventNames[i]} not found.");
}
if (indexFound < lastIndex)
{
- Assert.True(false, $"Event {eventNames[i]} found before {eventNames[i - 1]}.");
+ Assert.Fail($"Event {eventNames[i]} found before {eventNames[i - 1]}.");
}
lastIndex = indexFound;
diff --git a/test/EFCore.Specification.Tests/OptimisticConcurrencyTestBase.cs b/test/EFCore.Specification.Tests/OptimisticConcurrencyTestBase.cs
index c7c248ebfaf..9d55128e17d 100644
--- a/test/EFCore.Specification.Tests/OptimisticConcurrencyTestBase.cs
+++ b/test/EFCore.Specification.Tests/OptimisticConcurrencyTestBase.cs
@@ -138,7 +138,7 @@ public virtual Task Two_concurrency_issues_in_one_to_one_related_entities_can_be
try
{
c.SaveChanges();
- Assert.True(false, "Expected second exception due to conflict in principals.");
+ Assert.Fail("Expected second exception due to conflict in principals.");
}
catch (DbUpdateConcurrencyException ex2)
{
@@ -185,7 +185,7 @@ public virtual Task Two_concurrency_issues_in_one_to_many_related_entities_can_b
try
{
c.SaveChanges();
- Assert.True(false, "Expected second exception due to conflict in principals.");
+ Assert.Fail("Expected second exception due to conflict in principals.");
}
catch (DbUpdateConcurrencyException ex2)
{
diff --git a/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
index 152ab14c8dd..2d587b4560a 100644
--- a/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
+++ b/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
@@ -5567,40 +5567,34 @@ public virtual Task Navigation_based_on_complex_expression3(bool async)
[MemberData(nameof(IsAsyncData))]
public virtual async Task Navigation_based_on_complex_expression4(bool async)
// Nav expansion. Issue #17782.
- => Assert.Equal(
- "True",
- (await Assert.ThrowsAsync(
+ => await Assert.ThrowsAsync(
() => AssertQuery(
async,
ss => from lc1 in ss.Set().Select(f => (f is LocustHorde) ? ((LocustHorde)f).Commander : null)
from lc2 in ss.Set().OfType()
- select (lc1 ?? lc2).DefeatedBy))).Actual);
+ select (lc1 ?? lc2).DefeatedBy));
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual async Task Navigation_based_on_complex_expression5(bool async)
// Nav expansion. Issue #17782.
- => Assert.Equal(
- "True",
- (await Assert.ThrowsAsync(
+ => await Assert.ThrowsAsync(
() => AssertQuery(
async,
ss => from lc1 in ss.Set().OfType().Select(lh => lh.Commander)
join lc2 in ss.Set().OfType() on true equals true
- select (lc1 ?? lc2).DefeatedBy))).Actual);
+ select (lc1 ?? lc2).DefeatedBy));
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual async Task Navigation_based_on_complex_expression6(bool async)
// Nav expansion. Issue #17782.
- => Assert.Equal(
- "True",
- (await Assert.ThrowsAsync(
- () => AssertQuery(
- async,
- ss => from lc1 in ss.Set().OfType().Select(lh => lh.Commander)
- join lc2 in ss.Set().OfType() on true equals true
- select (lc1.Name == "Queen Myrrah" ? lc1 : lc2).DefeatedBy))).Actual);
+ => await Assert.ThrowsAsync(
+ () => AssertQuery(
+ async,
+ ss => from lc1 in ss.Set().OfType().Select(lh => lh.Commander)
+ join lc2 in ss.Set().OfType() on true equals true
+ select (lc1.Name == "Queen Myrrah" ? lc1 : lc2).DefeatedBy));
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
diff --git a/test/EFCore.Specification.Tests/Query/NorthwindCompiledQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindCompiledQueryTestBase.cs
index 832e0dc7ca7..f23c53ccf3b 100644
--- a/test/EFCore.Specification.Tests/Query/NorthwindCompiledQueryTestBase.cs
+++ b/test/EFCore.Specification.Tests/Query/NorthwindCompiledQueryTestBase.cs
@@ -537,11 +537,8 @@ public virtual void Compiled_query_when_using_member_on_context()
context.TenantPrefix = "A";
// Parameter-specific evaluation in ParameterExtractor. Issue #19209.
- Assert.Equal(
- "4",
- Assert.Throws(
- () =>
- Assert.Equal(6, query(context).Count())).Actual);
+ // Assert.Equal(6, query(context).Count())
+ Assert.Equal(4, query(context).Count());
context.TenantPrefix = "B";
Assert.Equal(4, query(context).Count());
diff --git a/test/EFCore.Specification.Tests/TestUtilities/TestStore.cs b/test/EFCore.Specification.Tests/TestUtilities/TestStore.cs
index 9dadb6a7d47..789e46655f6 100644
--- a/test/EFCore.Specification.Tests/TestUtilities/TestStore.cs
+++ b/test/EFCore.Specification.Tests/TestUtilities/TestStore.cs
@@ -126,7 +126,7 @@ public DistributedTransactionListener()
}
private void DistributedTransactionStarted(object sender, TransactionEventArgs e)
- => Assert.False(true, "Distributed transaction started");
+ => Assert.Fail("Distributed transaction started");
public void Dispose()
=> TransactionManager.DistributedTransactionStarted -= DistributedTransactionStarted;
diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs
index 590596a180d..661c55d1484 100644
--- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs
+++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs
@@ -49,10 +49,8 @@ public virtual void Check_all_tests_overridden()
public override async Task Include_where_list_contains_navigation(bool async)
{
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(
- () => base.Include_where_list_contains_navigation(async))).Actual);
+ await Assert.ThrowsAsync(
+ () => base.Include_where_list_contains_navigation(async));
AssertSql(
"""
@@ -75,10 +73,8 @@ FROM OPENJSON(@__tags_0) WITH ([value] uniqueidentifier '$') AS [t0]
public override async Task Include_where_list_contains_navigation2(bool async)
{
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(
- () => base.Include_where_list_contains_navigation2(async))).Actual);
+ await Assert.ThrowsAsync(
+ () => base.Include_where_list_contains_navigation2(async));
AssertSql(
"""
@@ -102,10 +98,8 @@ FROM OPENJSON(@__tags_0) WITH ([value] uniqueidentifier '$') AS [t0]
public override async Task Navigation_accessed_twice_outside_and_inside_subquery(bool async)
{
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(
- () => base.Navigation_accessed_twice_outside_and_inside_subquery(async))).Actual);
+ await Assert.ThrowsAsync(
+ () => base.Navigation_accessed_twice_outside_and_inside_subquery(async));
AssertSql(
"""
@@ -129,10 +123,8 @@ FROM OPENJSON(@__tags_0) WITH ([value] uniqueidentifier '$') AS [t0]
public override async Task Query_reusing_parameter_with_inner_query_doesnt_declare_duplicate_parameter(bool async)
{
// Test infra issue
- Assert.Equal(
- "0",
- (await Assert.ThrowsAsync(
- () => base.Query_reusing_parameter_with_inner_query_doesnt_declare_duplicate_parameter(async))).Actual);
+ await Assert.ThrowsAsync(
+ () => base.Query_reusing_parameter_with_inner_query_doesnt_declare_duplicate_parameter(async));
AssertSql(
"""
@@ -167,7 +159,7 @@ public override async Task
{
// Test infra issue
await Assert.ThrowsAsync(
- () => base.Multiple_includes_with_client_method_around_entity_and_also_projecting_included_collection());
+ base.Multiple_includes_with_client_method_around_entity_and_also_projecting_included_collection);
AssertSql(
"""
@@ -186,10 +178,8 @@ FROM [Gears] AS [g]
public override void Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result1() // Test infra issue
{
// Test infra issue
- Assert.Equal(
- "[]",
- Assert.Throws(
- () => base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result1()).Actual);
+ Assert.Throws(
+ base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result1);
AssertSql(
"""
@@ -204,10 +194,8 @@ FROM [Gears] AS [g]
public override void Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result2() // Test infra issue
{
// Test infra issue
- Assert.Equal(
- "[]",
- Assert.Throws(
- () => base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result2()).Actual);
+ Assert.Throws(
+ base.Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result2);
AssertSql(
"""
@@ -222,10 +210,8 @@ FROM [Gears] AS [g]
public override void Byte_array_filter_by_length_parameter_compiled()
{
// Test infra issue
- Assert.Equal(
- "0",
- Assert.Throws(
- () => base.Byte_array_filter_by_length_parameter_compiled()).Actual);
+ Assert.Throws(
+ base.Byte_array_filter_by_length_parameter_compiled);
AssertSql(
"""
diff --git a/test/EFCore.Tests/Infrastructure/EventIdTestBase.cs b/test/EFCore.Tests/Infrastructure/EventIdTestBase.cs
index 357f7b4773d..0cf49b87215 100644
--- a/test/EFCore.Tests/Infrastructure/EventIdTestBase.cs
+++ b/test/EFCore.Tests/Infrastructure/EventIdTestBase.cs
@@ -120,8 +120,7 @@ public void TestEventLogging(
}
catch (Exception)
{
- Assert.True(
- false,
+ Assert.Fail(
"Need to add fake test factory for type "
+ type.DisplayName()
+ " in class "
diff --git a/test/EFCore.Tests/ModelBuilding/ModelBuilderNonGenericStringTest.cs b/test/EFCore.Tests/ModelBuilding/ModelBuilderNonGenericStringTest.cs
index f3133c0bba4..7370d0dcbba 100644
--- a/test/EFCore.Tests/ModelBuilding/ModelBuilderNonGenericStringTest.cs
+++ b/test/EFCore.Tests/ModelBuilding/ModelBuilderNonGenericStringTest.cs
@@ -36,11 +36,8 @@ protected override TestModelBuilder CreateTestModelBuilder(
public override void WithMany_pointing_to_keyless_entity_throws()
// Test throws exception before reaching the first exception due to entity type being property bag entity
- => Assert.Equal(
- CoreStrings.NavigationSingleWrongClrType(
- "Reference", "KeylessCollectionNavigation", "KeylessReferenceNavigation", "Dictionary"),
- Assert.Throws(
- () => base.WithMany_pointing_to_keyless_entity_throws()).Actual);
+ => Assert.Throws(
+ base.WithMany_pointing_to_keyless_entity_throws);
}
public class NonGenericStringManyToOneType : ManyToOneTestBase
diff --git a/test/EFCore.Tests/ModelBuilding/OwnedTypesTestBase.cs b/test/EFCore.Tests/ModelBuilding/OwnedTypesTestBase.cs
index 3cd6ad75c0a..0c06602c597 100644
--- a/test/EFCore.Tests/ModelBuilding/OwnedTypesTestBase.cs
+++ b/test/EFCore.Tests/ModelBuilding/OwnedTypesTestBase.cs
@@ -574,7 +574,7 @@ public virtual void Can_configure_owned_type_from_an_owned_type_collection(HasDa
ownedNavigationBuilder.HasData(new List { new() { OrderId = -1 } });
break;
default:
- Assert.True(false, $"Unexpected HasData overload specification {hasDataOverload}");
+ Assert.Fail($"Unexpected HasData overload specification {hasDataOverload}");
break;
}
});
diff --git a/test/ef.Tests/TestUtilities/WrappedXunitException.cs b/test/ef.Tests/TestUtilities/WrappedXunitException.cs
index f118f7c19fe..79f72f8e0ec 100644
--- a/test/ef.Tests/TestUtilities/WrappedXunitException.cs
+++ b/test/ef.Tests/TestUtilities/WrappedXunitException.cs
@@ -8,7 +8,7 @@ namespace Microsoft.EntityFrameworkCore.Tools;
internal class WrappedXunitException : XunitException
{
public WrappedXunitException(WrappedException ex)
- : base(ex.ToString(), "(See error message)")
+ : base("(See error message)", ex)
{
}
}