diff --git a/Directory.Packages.props b/Directory.Packages.props
index fa6c6b8cb..ee9d3ac0d 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -23,7 +23,7 @@
-
+
diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs
index 43cec53bb..aa4a2ccdf 100644
--- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs
+++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs
@@ -1994,7 +1994,7 @@ await Test(
{
var table = Assert.Single(model.Tables);
var index = Assert.Single(table.Indexes);
- Assert.Equal(1, index.Columns.Count);
+ Assert.Single(index.Columns);
Assert.Contains(table.Columns.Single(c => c.Name == "Name"), index.Columns);
// Scaffolding included/covered properties is currently blocked, see #2194
@@ -2038,7 +2038,7 @@ await Test(
var table = Assert.Single(model.Tables);
var index = Assert.Single(table.Indexes);
Assert.Equal(@"(""Name"" IS NOT NULL)", index.Filter);
- Assert.Equal(1, index.Columns.Count);
+ Assert.Single(index.Columns);
Assert.Contains(table.Columns.Single(c => c.Name == "Name"), index.Columns);
// Scaffolding included/covered properties is currently blocked, see #2194
@@ -2082,7 +2082,7 @@ await Test(
var table = Assert.Single(model.Tables);
var index = Assert.Single(table.Indexes);
Assert.True(index.IsUnique);
- Assert.Equal(1, index.Columns.Count);
+ Assert.Single(index.Columns);
Assert.Contains(table.Columns.Single(c => c.Name == "Name"), index.Columns);
// Scaffolding included/covered properties is currently blocked, see #2194
@@ -2128,7 +2128,7 @@ await Test(
var index = Assert.Single(table.Indexes);
Assert.True(index.IsUnique);
Assert.Equal(@"(""Name"" IS NOT NULL)", index.Filter);
- Assert.Equal(1, index.Columns.Count);
+ Assert.Single(index.Columns);
Assert.Contains(table.Columns.Single(c => c.Name == "Name"), index.Columns);
// Scaffolding included/covered properties is currently blocked, see #2194
diff --git a/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs b/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs
index b064d2f81..6ed2565f4 100644
--- a/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs
+++ b/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs
@@ -186,7 +186,7 @@ public void Filter_schemas()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -209,7 +209,7 @@ public void Filter_tables()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -232,7 +232,7 @@ public void Filter_tables_with_qualified_name()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K.2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -256,7 +256,7 @@ public void Filter_tables_with_schema_qualified_name1()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -281,7 +281,7 @@ public void Filter_tables_with_schema_qualified_name2()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K.2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -306,7 +306,7 @@ public void Filter_tables_with_schema_qualified_name3()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K.2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -331,7 +331,7 @@ public void Filter_tables_with_schema_qualified_name4()
// ReSharper disable once PossibleNullReferenceException
Assert.Equal("K2", table.Name);
Assert.Equal(2, table.Columns.Count);
- Assert.Equal(1, table.UniqueConstraints.Count);
+ Assert.Single(table.UniqueConstraints);
Assert.Empty(table.ForeignKeys);
},
"""
@@ -1060,12 +1060,7 @@ CREATE TABLE "SystemColumnsTable"
""",
Enumerable.Empty(),
Enumerable.Empty(),
- dbModel =>
- {
- var columns = dbModel.Tables.Single().Columns;
-
- Assert.Equal(1, columns.Count);
- },
+ dbModel => Assert.Single(dbModel.Tables.Single().Columns),
@"DROP TABLE ""SystemColumnsTable""");
#endregion
@@ -2027,11 +2022,8 @@ public void Bug453()
""",
Enumerable.Empty(),
Enumerable.Empty(),
- dbModel =>
- {
- // Enum columns are left out of the model for now (a warning is logged).
- Assert.Equal(1, dbModel.Tables.Single(t => t.Name == "foo").Columns.Count);
- },
+ // Enum columns are left out of the model for now (a warning is logged).
+ dbModel => Assert.Single(dbModel.Tables.Single(t => t.Name == "foo").Columns),
"""
DROP TABLE bar;
DROP TABLE foo;
diff --git a/test/EFCore.PG.Tests/Design/Internal/NpgsqlAnnotationCodeGeneratorTest.cs b/test/EFCore.PG.Tests/Design/Internal/NpgsqlAnnotationCodeGeneratorTest.cs
index 5a93964cf..01cca126d 100644
--- a/test/EFCore.PG.Tests/Design/Internal/NpgsqlAnnotationCodeGeneratorTest.cs
+++ b/test/EFCore.PG.Tests/Design/Internal/NpgsqlAnnotationCodeGeneratorTest.cs
@@ -39,7 +39,7 @@ public void GenerateFluentApi_value_generation()
var result = generator.GenerateFluentApiCalls(property, property.GetAnnotations().ToDictionary(a => a.Name, a => a))
.Single();
Assert.Equal(nameof(NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn), result.Method);
- Assert.Equal(0, result.Arguments.Count);
+ Assert.Empty(result.Arguments);
property = entity.GetProperties().Single(p => p.Name == "IdentityAlways");
annotations = property.GetAnnotations().ToDictionary(a => a.Name, a => a);
@@ -47,7 +47,7 @@ public void GenerateFluentApi_value_generation()
Assert.Contains(annotations, kv => kv.Key == NpgsqlAnnotationNames.ValueGenerationStrategy);
result = generator.GenerateFluentApiCalls(property, annotations).Single();
Assert.Equal(nameof(NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn), result.Method);
- Assert.Equal(0, result.Arguments.Count);
+ Assert.Empty(result.Arguments);
property = entity.GetProperties().Single(p => p.Name == "Serial");
annotations = property.GetAnnotations().ToDictionary(a => a.Name, a => a);
@@ -56,7 +56,7 @@ public void GenerateFluentApi_value_generation()
result = generator.GenerateFluentApiCalls(property, property.GetAnnotations().ToDictionary(a => a.Name, a => a))
.Single();
Assert.Equal(nameof(NpgsqlPropertyBuilderExtensions.UseSerialColumn), result.Method);
- Assert.Equal(0, result.Arguments.Count);
+ Assert.Empty(result.Arguments);
property = entity.GetProperties().Single(p => p.Name == "None");
annotations = property.GetAnnotations().ToDictionary(a => a.Name, a => a);