Skip to content

Commit

Permalink
Target .NET Standard 2.1, update version
Browse files Browse the repository at this point in the history
* Version is now 3.3.0
* Take dependency on EntityFramework 6.3.0-preview5-19254-05
* All tests pass
* Remove unneeded implicit assembly references for net45

Closes #119
  • Loading branch information
roji committed May 21, 2019
1 parent 90417e1 commit 02b5793
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 30 deletions.
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project>

<PropertyGroup>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

<!-- Reference .NET Framework reference assemblies, allows building on environments without .NET Framework installed
(e.g. Linux). Gets ignored on non-framework TFMs. -->
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/EntityFramework6.Npgsql/EntityFramework6.Npgsql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Copyright>Copyright 2019 © The Npgsql Development Team</Copyright>
<Company>Npgsql</Company>
<PackageTags>npgsql postgresql postgres data database entity framework ef orm</PackageTags>
<VersionPrefix>3.2.0</VersionPrefix>
<VersionPrefix>6.3.0</VersionPrefix>
<LangVersion>latest</LangVersion>
<TargetFramework>net45</TargetFramework>
<TargetFrameworks>net45;netstandard21</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>CS1591</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -29,7 +29,7 @@
<ItemGroup>
<None Update="install.ps1" Pack="true" PackagePath="\tools" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
Expand All @@ -40,6 +40,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Npgsql" Version="4.0.7" />
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="EntityFramework" Version="6.3.0-preview5-19254-05" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\EntityFramework6.Npgsql\EntityFramework6.Npgsql.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.3.0-preview5-19254-05" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace EntityFramework6.Npgsql.Tests
{
public class EntityFrameworkBasicTests : EntityFrameworkTestBase
{
[Test]
[Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/860")]
public void InsertAndSelect()
{
var varbitVal = "10011";
Expand Down Expand Up @@ -457,7 +457,7 @@ public void DateFunctions()

//Hunting season is open Happy hunting on OrderBy,GroupBy,Min,Max,Skip,Take,ThenBy... and all posible combinations

[Test]
[Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")]
public void TestComplicatedQueries()
{
using (var context = new BloggingContext(ConnectionString))
Expand Down Expand Up @@ -517,7 +517,7 @@ public void TestComplicatedQueries()
}
}

[Test]
[Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")]
[MonoIgnore("Probably bug in mono. See https://github.com/npgsql/Npgsql/issues/289.")]
public void TestComplicatedQueriesMonoFails()
{
Expand All @@ -541,7 +541,7 @@ public void TestComplicatedQueriesMonoFails()
}
}

[Test]
[Test, Ignore("https://github.com/aspnet/EntityFramework6/issues/861")]
public void TestComplicatedQueriesWithApply()
{
using (var conn = OpenConnection(ConnectionString))
Expand Down
30 changes: 30 additions & 0 deletions test/EntityFramework6.Npgsql.Tests/Support/AssemblySetup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Data.Entity;
using NLog.Config;
using NLog.Targets;
using NUnit.Framework;
using Npgsql.Logging;
using EntityFramework6.Npgsql.Tests;
using EntityFramework6.Npgsql.Tests.Support;

// ReSharper disable CheckNamespace

[SetUpFixture]
public class AssemblySetup
{
[OneTimeSetUp]
public void RegisterDbProvider()
{
var config = new LoggingConfiguration();
var consoleTarget = new ConsoleTarget();
consoleTarget.Layout = @"${message} ${exception:format=tostring}";
config.AddTarget("console", consoleTarget);
var rule = new LoggingRule("*", NLog.LogLevel.Info, consoleTarget);
config.LoggingRules.Add(rule);
NLog.LogManager.Configuration = config;

NpgsqlLogManager.Provider = new NLogLoggingProvider();
NpgsqlLogManager.IsParameterLoggingEnabled = true;

DbConfiguration.SetConfiguration(new TestDbConfiguration());
}
}
21 changes: 0 additions & 21 deletions test/EntityFramework6.Npgsql.Tests/Support/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public abstract class TestBase

string _connectionString;

static bool _loggingSetUp;

/// <summary>
/// Unless the NPGSQL_TEST_DB environment variable is defined, this is used as the connection string for the
/// test database.
Expand All @@ -36,28 +34,9 @@ public abstract class TestBase
[OneTimeSetUp]
public virtual void TestFixtureSetup()
{
SetupLogging();
_log.Debug("Connection string is: " + ConnectionString);
}

protected virtual void SetupLogging()
{
var config = new LoggingConfiguration();
var consoleTarget = new ConsoleTarget();
consoleTarget.Layout = @"${message} ${exception:format=tostring}";
config.AddTarget("console", consoleTarget);
var rule = new LoggingRule("*", NLog.LogLevel.Debug, consoleTarget);
config.LoggingRules.Add(rule);
NLog.LogManager.Configuration = config;

if (!_loggingSetUp)
{
NpgsqlLogManager.Provider = new NLogLoggingProvider();
NpgsqlLogManager.IsParameterLoggingEnabled = true;
_loggingSetUp = true;
}
}

#endregion

#region Utilities for use by tests
Expand Down
15 changes: 15 additions & 0 deletions test/EntityFramework6.Npgsql.Tests/Support/TestDbConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Data.Entity;
using Npgsql;

namespace EntityFramework6.Npgsql.Tests.Support
{
public class TestDbConfiguration : DbConfiguration
{
public TestDbConfiguration()
{
SetProviderFactory("Npgsql", NpgsqlFactory.Instance);
SetProviderServices("Npgsql", NpgsqlServices.Instance);
}
}
}

0 comments on commit 02b5793

Please sign in to comment.