Skip to content

Commit 73ae9f1

Browse files
committed
Annotate functional tests for nullability
Where the base classes are annotated
1 parent 9cce847 commit 73ae9f1

File tree

90 files changed

+251
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+251
-236
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<VersionPrefix>10.0.0</VersionPrefix>
44
<TargetFramework>net10.0</TargetFramework>
55
<LangVersion>latest</LangVersion>
6+
<Nullable>enable</Nullable>
67
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
78
<AnalysisLevel>latest</AnalysisLevel>
89
<NoWarn>NU5105</NoWarn>

src/Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<IncludeSymbols>true</IncludeSymbols>
66
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
77
<EmbedUntrackedSources>true</EmbedUntrackedSources>
8-
<Nullable>enable</Nullable>
98
<Feature>nullablePublicOnly</Feature>
109
</PropertyGroup>
1110

test/EFCore.PG.FunctionalTests/BadDataJsonDeserializationNpgsqlTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#nullable enable
2-
31
namespace Npgsql.EntityFrameworkCore.PostgreSQL;
42

53
public class BadDataJsonDeserializationSqlServerTest : BadDataJsonDeserializationTestBase

test/EFCore.PG.FunctionalTests/BatchingTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// ReSharper disable InconsistentNaming
88
namespace Npgsql.EntityFrameworkCore.PostgreSQL;
99

10+
#nullable disable
11+
1012
public class BatchingTest(BatchingTest.BatchingTestFixture fixture) : IClassFixture<BatchingTest.BatchingTestFixture>
1113
{
1214
protected BatchingTestFixture Fixture { get; } = fixture;

test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace Npgsql.EntityFrameworkCore.PostgreSQL;
77

8+
#nullable disable
9+
810
public class BuiltInDataTypesNpgsqlTest : BuiltInDataTypesTestBase<BuiltInDataTypesNpgsqlTest.BuiltInDataTypesNpgsqlFixture>
911
{
1012
// ReSharper disable once UnusedParameter.Local

test/EFCore.PG.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesNpgsqlTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected class Context3001(DbContextOptions options) : DbContext(options)
236236
protected class EntityWithPrimitiveCollection
237237
{
238238
public int Id { get; set; }
239-
public List<string> Tags { get; set; }
239+
public List<string> Tags { get; set; } = null!;
240240
}
241241

242242
public override async Task Delete_with_view_mapping(bool async)

test/EFCore.PG.FunctionalTests/ComputedColumnTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void Can_use_computed_columns_with_nullable_enum()
134134
Assert.Equal(FlagEnum.AValue | FlagEnum.BValue, entity.CalculatedFlagEnum);
135135
}
136136

137-
protected NpgsqlTestStore TestStore { get; private set; }
137+
protected NpgsqlTestStore TestStore { get; private set; } = null!;
138138

139139
public async Task InitializeAsync()
140140
=> TestStore = await NpgsqlTestStore.CreateInitializedAsync("ComputedColumnTest");

test/EFCore.PG.FunctionalTests/ConferencePlannerNpgsqlTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Npgsql.EntityFrameworkCore.PostgreSQL;
66

7+
#nullable disable
8+
79
public class ConferencePlannerNpgsqlTest(ConferencePlannerNpgsqlTest.ConferencePlannerNpgsqlFixture fixture)
810
: ConferencePlannerTestBase<ConferencePlannerNpgsqlTest.ConferencePlannerNpgsqlFixture>(fixture)
911
{

test/EFCore.PG.FunctionalTests/ConnectionInterceptionNpgsqlTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Data;
22
using System.Data.Common;
3+
using System.Diagnostics.CodeAnalysis;
34
using Npgsql.EntityFrameworkCore.PostgreSQL.TestUtilities;
45

56
namespace Npgsql.EntityFrameworkCore.PostgreSQL;
@@ -45,6 +46,7 @@ protected override BadUniverseContext CreateBadUniverse(DbContextOptionsBuilder
4546

4647
public class FakeDbConnection : DbConnection
4748
{
49+
[AllowNull]
4850
public override string ConnectionString { get; set; }
4951

5052
public override string Database

test/EFCore.PG.FunctionalTests/ConnectionSpecificationTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// ReSharper disable StringLiteralTypo
55
namespace Npgsql.EntityFrameworkCore.PostgreSQL;
66

7+
#nullable disable
8+
79
public class ConnectionSpecificationTest
810
{
911
[Fact]

0 commit comments

Comments
 (0)