From 106d52837bf334d10dc297094d4e0cd87f27b220 Mon Sep 17 00:00:00 2001 From: Philippe Birbaum Date: Sat, 7 Dec 2019 07:42:45 +0100 Subject: [PATCH] Support for lower .NETCore frameworks (#10) * Support for lower .NETCore frameworks * Reference project instead of nuget in samples --- global.json | 2 +- samples/Context/DataAccess/DataAccess.csproj | 5 +++-- src/Context.Tests/Context.Tests.csproj | 4 ++-- .../MongoCollectionBuilderTests.cs | 11 +++++----- src/Context/Context.csproj | 21 ++++++++++++++++--- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/global.json b/global.json index 79422f0..e9aac8c 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.0.100" + "version": "3.1.100" } } diff --git a/samples/Context/DataAccess/DataAccess.csproj b/samples/Context/DataAccess/DataAccess.csproj index 4675462..ff66ba9 100644 --- a/samples/Context/DataAccess/DataAccess.csproj +++ b/samples/Context/DataAccess/DataAccess.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0 SimpleBlog.DataAccess SimpleBlog.DataAccess false @@ -11,11 +11,12 @@ - + + diff --git a/src/Context.Tests/Context.Tests.csproj b/src/Context.Tests/Context.Tests.csproj index 8355948..8fb86c6 100644 --- a/src/Context.Tests/Context.Tests.csproj +++ b/src/Context.Tests/Context.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.0 + netcoreapp2.2;netcoreapp3.0;netcoreapp3.1 MongoDB.Extensions.Context.Tests MongoDB.Extensions.Context.Tests false diff --git a/src/Context.Tests/MongoCollectionBuilderTests.cs b/src/Context.Tests/MongoCollectionBuilderTests.cs index 705454f..dff0a1e 100644 --- a/src/Context.Tests/MongoCollectionBuilderTests.cs +++ b/src/Context.Tests/MongoCollectionBuilderTests.cs @@ -170,6 +170,7 @@ public void WithMongoCollectionSettings_NoCollectionSettingsConfigured_DefaultMo Assert.True(result.Settings.AssignIdOnInsert); } + #if NETCOREAPP3_1 [Fact] public void WithMongoCollectionSettings_DefaultCollectionSettingsConfigured_DefaultMongoCollectionSettingsSet() { @@ -187,10 +188,10 @@ public void WithMongoCollectionSettings_DefaultCollectionSettingsConfigured_Defa Assert.Equal(ReadPreference.Primary, result.Settings.ReadPreference); Assert.True(result.Settings.AssignIdOnInsert); } + #endif +#endregion - #endregion - - #region WithMongoCollectionConfiguration Tests +#region WithMongoCollectionConfiguration Tests [Fact] public void WithMongoCollectionConfiguration_ChangeCollectionConfiguration_MongoCollectionConfigurationChangedSuccessfully() @@ -211,9 +212,9 @@ public void WithMongoCollectionConfiguration_ChangeCollectionConfiguration_Mongo // List indexes = result.Indexes.List().ToList(); Assert.Equal("_id_", indexes.First().GetElement("name").Value.ToString()); - Assert.Equal("Name_1", indexes.Last().GetElement("name").Value.ToString()); + Assert.Equal("Name_1".ToLower(), indexes.Last().GetElement("name").Value.ToString().ToLower()); } - #endregion +#endregion } } diff --git a/src/Context/Context.csproj b/src/Context/Context.csproj index 2fc8b44..90d54a6 100644 --- a/src/Context/Context.csproj +++ b/src/Context/Context.csproj @@ -1,8 +1,8 @@ - + - netstandard2.0 + netstandard2.0;netstandard2.1 MongoDB.Extensions.Context MongoDB.Extensions.Context MongoDB.Extensions.Context @@ -20,10 +20,25 @@ + + + + + + + + + + - + + + + + +