diff --git a/Tests/LinqToDB.EntityFrameworkCore.BaseTests/LinqToDB.EntityFrameworkCore.BaseTests.csproj b/Tests/LinqToDB.EntityFrameworkCore.BaseTests/LinqToDB.EntityFrameworkCore.BaseTests.csproj index 002be19..bf604a6 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.BaseTests/LinqToDB.EntityFrameworkCore.BaseTests.csproj +++ b/Tests/LinqToDB.EntityFrameworkCore.BaseTests/LinqToDB.EntityFrameworkCore.BaseTests.csproj @@ -10,6 +10,7 @@ + diff --git a/Tests/LinqToDB.EntityFrameworkCore.BaseTests/Logging/TestLogger.cs b/Tests/LinqToDB.EntityFrameworkCore.BaseTests/Logging/TestLogger.cs index 6879d86..d637fbc 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.BaseTests/Logging/TestLogger.cs +++ b/Tests/LinqToDB.EntityFrameworkCore.BaseTests/Logging/TestLogger.cs @@ -13,7 +13,9 @@ internal class TestLogger : ILogger private static readonly string _newLineWithMessagePadding; // ConsoleColor does not have a value to specify the 'Default' color +#pragma warning disable 649 private readonly ConsoleColor? DefaultConsoleColor; +#pragma warning restore 649 private readonly string _name; diff --git a/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/NpgSqlTests.cs b/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/NpgSqlTests.cs index 18e885d..ef7d1ef 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/NpgSqlTests.cs +++ b/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/NpgSqlTests.cs @@ -31,11 +31,13 @@ public NpgSqlTests() _options = optionsBuilder.Options; } - private NpgSqlEnititesContext CreateNpgSqlExntitiesContext() + private NpgSqlEnititesContext CreateNpgSqlEntitiesContext() { var ctx = new NpgSqlEnititesContext(_options); ctx.Database.EnsureDeleted(); ctx.Database.EnsureCreated(); + ctx.Database.ExecuteSqlRaw("create schema \"views\""); + ctx.Database.ExecuteSqlRaw("create view \"views\".\"EventsView\" as select \"Name\" from \"Events\""); return ctx; } @@ -43,7 +45,7 @@ private NpgSqlEnititesContext CreateNpgSqlExntitiesContext() [Test] public void TestFunctionsMapping() { - using (var db = CreateNpgSqlExntitiesContext()) + using (var db = CreateNpgSqlEntitiesContext()) { var date = DateTime.UtcNow; diff --git a/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/SampleTests/AAA.cs b/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/SampleTests/AAA.cs index 475ffce..756370e 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/SampleTests/AAA.cs +++ b/Tests/LinqToDB.EntityFrameworkCore.PostgreSQL.Tests/SampleTests/AAA.cs @@ -1,6 +1,9 @@ using System; using System.Threading.Tasks; +#pragma warning disable 8604 +#pragma warning disable CS8625 + namespace LinqToDB.EntityFrameworkCore.PostgreSQL.Tests.SampleTests { public class Unit diff --git a/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/IssueTests.cs b/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/IssueTests.cs index 2afa3d8..27c0815 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/IssueTests.cs +++ b/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/IssueTests.cs @@ -9,7 +9,7 @@ namespace LinqToDB.EntityFrameworkCore.SqlServer.Tests [TestFixture] public class IssueTests : TestsBase { - private DbContextOptions? _options; + private DbContextOptions _options = null!; private bool _created; public IssueTests() diff --git a/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/Models/IssueModel/IssueContext.cs b/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/Models/IssueModel/IssueContext.cs index 76d8d99..e8dee5c 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/Models/IssueModel/IssueContext.cs +++ b/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/Models/IssueModel/IssueContext.cs @@ -43,7 +43,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder .Entity() .HasOne(p => p.Assessment) - .WithOne(pa => pa.Patent) + .WithOne(pa => pa!.Patent) .HasForeignKey(pa => pa.PatentId) .OnDelete(DeleteBehavior.Restrict); diff --git a/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/ToolsTests.cs b/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/ToolsTests.cs index 6e55836..d50e25b 100644 --- a/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/ToolsTests.cs +++ b/Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/ToolsTests.cs @@ -669,7 +669,7 @@ public async Task TestSetUpdate([Values(true, false)] bool enableFilter) { using (var ctx = CreateContext(enableFilter)) { - var customer = await ctx.Customers.FirstOrDefaultAsync(); + var customer = await ctx.Customers.FirstAsync(); var updatable = ctx.Customers.Where(c => c.CustomerId == customer.CustomerId) .Set(c => c.CompanyName, customer.CompanyName);