From 686417412aba3e22c987a4b6dce537697cb51e59 Mon Sep 17 00:00:00 2001 From: Mariusz Matysek Date: Thu, 17 Oct 2024 13:02:03 +0200 Subject: [PATCH] Carael/bump mongo driver (#97) Co-authored-by: Normen Scheiber --- Directory.Packages.props | 59 ++++++++----------- samples/Directory.Packages.props | 6 +- samples/Migration/Migration.csproj | 3 +- samples/MongoDB.Extensions.Samples.sln | 38 ++++++++++++ .../MongoDatabaseBuilderTests.cs | 5 +- .../Properties/AssemblyInfo.cs | 3 + .../TypeObjectSerializerTests.cs | 12 ++-- ...AllowedTypesOfAllDependencies_Success.snap | 15 +---- ...AllowedTypesOfAllDependencies_Success.snap | 17 +----- ...wed_InAllowedTypesInDependencies_True.snap | 17 +----- .../Internal/DependencyTypesResolverTests.cs | 5 +- ...wedTypesByDependencies_All_Successful.snap | 17 +----- src/Context.Tests/Properties/AssemblyInfo.cs | 3 + src/MongoDB.Extensions.sln | 7 +++ 14 files changed, 98 insertions(+), 109 deletions(-) create mode 100644 src/Context.AllowedTypes.Tests/Properties/AssemblyInfo.cs create mode 100644 src/Context.Tests/Properties/AssemblyInfo.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index cb96397..71ce23e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,61 +1,52 @@ - true - - - - + + + - + - - + - - - - + + + - - - - + + + - + - - - - + + + - + - - - - + + + - + - - - - + + + - + - - + \ No newline at end of file diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index aa7d63d..0fc28bd 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -1,11 +1,7 @@ - - - - - + \ No newline at end of file diff --git a/samples/Migration/Migration.csproj b/samples/Migration/Migration.csproj index 1340d3a..42f0453 100644 --- a/samples/Migration/Migration.csproj +++ b/samples/Migration/Migration.csproj @@ -7,8 +7,7 @@ - - + diff --git a/samples/MongoDB.Extensions.Samples.sln b/samples/MongoDB.Extensions.Samples.sln index 33fc83c..639e43e 100644 --- a/samples/MongoDB.Extensions.Samples.sln +++ b/samples/MongoDB.Extensions.Samples.sln @@ -34,6 +34,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{ED75 Directory.Packages.props = Directory.Packages.props EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Context", "..\src\Context\Context.csproj", "{C3BB5B96-BE90-43F8-BB59-C4610E21152A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{97896734-F855-4E7F-8BAF-9099D8ABCC90}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Transactions", "..\src\Transactions\Transactions.csproj", "{E4C04570-8EB7-48B6-9099-01BAE4F1155F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session", "..\src\Session\Session.csproj", "{ED223FF3-7F6B-46B5-9A87-6694DB555C6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prime.Extensions", "..\src\Prime.Extensions\Prime.Extensions.csproj", "{67DC36E5-D3B7-4912-A255-D582B1DEB728}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration", "..\src\Migration\Migration.csproj", "{E5A11398-5B6F-43AF-B4B0-133B0FA9218C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -60,6 +72,26 @@ Global {8226313B-FAC9-4D0F-AEE8-424DD310BBFB}.Debug|Any CPU.Build.0 = Debug|Any CPU {8226313B-FAC9-4D0F-AEE8-424DD310BBFB}.Release|Any CPU.ActiveCfg = Release|Any CPU {8226313B-FAC9-4D0F-AEE8-424DD310BBFB}.Release|Any CPU.Build.0 = Release|Any CPU + {C3BB5B96-BE90-43F8-BB59-C4610E21152A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3BB5B96-BE90-43F8-BB59-C4610E21152A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3BB5B96-BE90-43F8-BB59-C4610E21152A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3BB5B96-BE90-43F8-BB59-C4610E21152A}.Release|Any CPU.Build.0 = Release|Any CPU + {E4C04570-8EB7-48B6-9099-01BAE4F1155F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4C04570-8EB7-48B6-9099-01BAE4F1155F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4C04570-8EB7-48B6-9099-01BAE4F1155F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4C04570-8EB7-48B6-9099-01BAE4F1155F}.Release|Any CPU.Build.0 = Release|Any CPU + {ED223FF3-7F6B-46B5-9A87-6694DB555C6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED223FF3-7F6B-46B5-9A87-6694DB555C6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED223FF3-7F6B-46B5-9A87-6694DB555C6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED223FF3-7F6B-46B5-9A87-6694DB555C6C}.Release|Any CPU.Build.0 = Release|Any CPU + {67DC36E5-D3B7-4912-A255-D582B1DEB728}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67DC36E5-D3B7-4912-A255-D582B1DEB728}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67DC36E5-D3B7-4912-A255-D582B1DEB728}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67DC36E5-D3B7-4912-A255-D582B1DEB728}.Release|Any CPU.Build.0 = Release|Any CPU + {E5A11398-5B6F-43AF-B4B0-133B0FA9218C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5A11398-5B6F-43AF-B4B0-133B0FA9218C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5A11398-5B6F-43AF-B4B0-133B0FA9218C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5A11398-5B6F-43AF-B4B0-133B0FA9218C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -75,6 +107,12 @@ Global {0CCED088-DBB6-4DA2-8DFC-D9968EEBB9FA} = {C4DEA4A3-B50A-4ACD-9017-4919576CE069} {8226313B-FAC9-4D0F-AEE8-424DD310BBFB} = {ED7512B7-0598-4815-9DE5-B3BE0F55C1D2} {ED7512B7-0598-4815-9DE5-B3BE0F55C1D2} = {5366F688-8087-42D7-BBB3-3D8E6391AD44} + {97896734-F855-4E7F-8BAF-9099D8ABCC90} = {5366F688-8087-42D7-BBB3-3D8E6391AD44} + {C3BB5B96-BE90-43F8-BB59-C4610E21152A} = {97896734-F855-4E7F-8BAF-9099D8ABCC90} + {E4C04570-8EB7-48B6-9099-01BAE4F1155F} = {97896734-F855-4E7F-8BAF-9099D8ABCC90} + {ED223FF3-7F6B-46B5-9A87-6694DB555C6C} = {97896734-F855-4E7F-8BAF-9099D8ABCC90} + {67DC36E5-D3B7-4912-A255-D582B1DEB728} = {97896734-F855-4E7F-8BAF-9099D8ABCC90} + {E5A11398-5B6F-43AF-B4B0-133B0FA9218C} = {97896734-F855-4E7F-8BAF-9099D8ABCC90} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E28A6DDE-2575-483D-8C8B-7929357BA44A} diff --git a/src/Context.AllowedTypes.Tests/MongoDatabaseBuilderTests.cs b/src/Context.AllowedTypes.Tests/MongoDatabaseBuilderTests.cs index a6d9657..9446c28 100644 --- a/src/Context.AllowedTypes.Tests/MongoDatabaseBuilderTests.cs +++ b/src/Context.AllowedTypes.Tests/MongoDatabaseBuilderTests.cs @@ -58,7 +58,10 @@ public void AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success() BsonSerializer.LookupSerializer(); Assert.True(registeredSerializer is TypeObjectSerializer); - Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent()); + Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent(), + options => options.Assert(fieldOption => + Assert.Contains("MongoDB", fieldOption + .Fields("AllowedTypesByDependencies[*]")))); } [Fact] diff --git a/src/Context.AllowedTypes.Tests/Properties/AssemblyInfo.cs b/src/Context.AllowedTypes.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2171200 --- /dev/null +++ b/src/Context.AllowedTypes.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] diff --git a/src/Context.AllowedTypes.Tests/TypeObjectSerializerTests.cs b/src/Context.AllowedTypes.Tests/TypeObjectSerializerTests.cs index 4732c88..05bd422 100644 --- a/src/Context.AllowedTypes.Tests/TypeObjectSerializerTests.cs +++ b/src/Context.AllowedTypes.Tests/TypeObjectSerializerTests.cs @@ -3,8 +3,6 @@ using Snapshooter.Xunit; using Xunit; -[assembly: CollectionBehavior(DisableTestParallelization = true)] - namespace MongoDB.Extensions.Context.AllowedTypes.Tests; public class TypeObjectSerializerTests @@ -19,7 +17,10 @@ public void AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success() TypeObjectSerializer.AddAllowedTypesOfAllDependencies(); // Assert - Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent()); + Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent(), + options => options.Assert(fieldOption => + Assert.Contains("MongoDB", fieldOption + .Fields("AllowedTypesByDependencies[*]")))); } [Fact] @@ -150,6 +151,9 @@ public void IsTypeAllowed_InAllowedTypesInDependencies_True() // Assert Assert.True(isAllowed); - Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent()); + Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent(), + options => options.Assert(fieldOption => + Assert.Contains("MongoDB", fieldOption + .Fields("AllowedTypesByDependencies[*]")))); } } diff --git a/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap b/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap index 00b573e..e6062f1 100644 --- a/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap +++ b/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap @@ -2,26 +2,13 @@ "AllowedTypes": [], "AllowedTypesByNamespaces": [], "AllowedTypesByDependencies": [ - "Amazon", - "AWSSDK", - "Castle", - "DnsClient", "Docker", - "FluentAssertions", - "ICSharpCode", "Internal", "MongoDB", - "Moq", "Newtonsoft", - "NuGet", "Polly", - "SharpCompress", - "Snappier", "Snapshooter", "Squadron", - "ThirdParty", - "TypeNameFormatter", - "Xunit", - "ZstdSharp" + "Xunit" ] } diff --git a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap index 00b573e..741744f 100644 --- a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap +++ b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap @@ -2,26 +2,11 @@ "AllowedTypes": [], "AllowedTypesByNamespaces": [], "AllowedTypesByDependencies": [ - "Amazon", - "AWSSDK", - "Castle", - "DnsClient", - "Docker", - "FluentAssertions", - "ICSharpCode", "Internal", "MongoDB", - "Moq", "Newtonsoft", - "NuGet", - "Polly", - "SharpCompress", - "Snappier", "Snapshooter", "Squadron", - "ThirdParty", - "TypeNameFormatter", - "Xunit", - "ZstdSharp" + "Xunit" ] } diff --git a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap index 313d766..9fa2569 100644 --- a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap +++ b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap @@ -7,26 +7,11 @@ ], "AllowedTypesByNamespaces": [], "AllowedTypesByDependencies": [ - "Amazon", - "AWSSDK", - "Castle", - "DnsClient", - "Docker", - "FluentAssertions", - "ICSharpCode", "Internal", "MongoDB", - "Moq", "Newtonsoft", - "NuGet", - "Polly", - "SharpCompress", - "Snappier", "Snapshooter", "Squadron", - "ThirdParty", - "TypeNameFormatter", - "Xunit", - "ZstdSharp" + "Xunit" ] } diff --git a/src/Context.Tests/Internal/DependencyTypesResolverTests.cs b/src/Context.Tests/Internal/DependencyTypesResolverTests.cs index 357d227..404b51f 100644 --- a/src/Context.Tests/Internal/DependencyTypesResolverTests.cs +++ b/src/Context.Tests/Internal/DependencyTypesResolverTests.cs @@ -18,6 +18,9 @@ public void GetAllowedTypesByDependencies_All_Successful() .OrderBy(x => x); // Assert - Snapshot.Match(knownNamespaces); + Snapshot.Match(knownNamespaces, + options => options.Assert(fieldOption => + Assert.Contains("MongoDB", fieldOption + .Fields("[*]")))); } } diff --git a/src/Context.Tests/Internal/__snapshots__/DependencyTypesResolverTests.GetAllowedTypesByDependencies_All_Successful.snap b/src/Context.Tests/Internal/__snapshots__/DependencyTypesResolverTests.GetAllowedTypesByDependencies_All_Successful.snap index 7268f8d..6a6f74f 100644 --- a/src/Context.Tests/Internal/__snapshots__/DependencyTypesResolverTests.GetAllowedTypesByDependencies_All_Successful.snap +++ b/src/Context.Tests/Internal/__snapshots__/DependencyTypesResolverTests.GetAllowedTypesByDependencies_All_Successful.snap @@ -1,23 +1,8 @@ [ - "Amazon", - "AWSSDK", - "Castle", - "DnsClient", - "Docker", - "FluentAssertions", - "ICSharpCode", "Internal", "MongoDB", - "Moq", "Newtonsoft", - "NuGet", - "Polly", - "SharpCompress", - "Snappier", "Snapshooter", "Squadron", - "ThirdParty", - "TypeNameFormatter", - "Xunit", - "ZstdSharp" + "Xunit" ] diff --git a/src/Context.Tests/Properties/AssemblyInfo.cs b/src/Context.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2171200 --- /dev/null +++ b/src/Context.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] diff --git a/src/MongoDB.Extensions.sln b/src/MongoDB.Extensions.sln index c0258ca..3efd372 100644 --- a/src/MongoDB.Extensions.sln +++ b/src/MongoDB.Extensions.sln @@ -27,7 +27,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tests", "Migratio EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".SolutionFiles", ".SolutionFiles", "{A21A1FF3-25C1-4FE1-994E-E16CDF98BB99}" ProjectSection(SolutionItems) = preProject + Dependencies.props = Dependencies.props + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + ..\Directory.Packages.props = ..\Directory.Packages.props + Package.props = Package.props + ResourceProject.props = ResourceProject.props TestProject.props = TestProject.props + Version.props = Version.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Context.AllowedTypes.Tests", "Context.AllowedTypes.Tests\Context.AllowedTypes.Tests.csproj", "{C59B2068-C3F4-4900-A1CB-7BFD63F94095}"