Skip to content

Commit

Permalink
Carael/bump mongo driver (#97)
Browse files Browse the repository at this point in the history
Co-authored-by: Normen Scheiber <[email protected]>
  • Loading branch information
Carael and nscheibe authored Oct 17, 2024
1 parent 939e001 commit 6864174
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 109 deletions.
59 changes: 25 additions & 34 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,61 +1,52 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Moq" Version="4.16.1" />
<PackageVersion Include="Snapshooter.Xunit" Version="0.13.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Squadron.Mongo" Version="0.18.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Squadron.Mongo" Version="0.22.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="Xunit.Priority" Version="1.1.6" />
<PackageVersion Include="FluentAssertions" Version="6.2.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="MongoDB.Driver" Version="2.24.0" />
<PackageVersion Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="1.3.0" />
<PackageVersion Include="System.Text.Json" Version="7.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.30.0" />
<PackageVersion Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="1.5.0" />
<PackageVersion Include="System.Text.Json" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="3.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="2.2.0" />
</ItemGroup>

</Project>
</Project>
6 changes: 1 addition & 5 deletions samples/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />

<ItemGroup>
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageVersion Include="NSwag.AspNetCore" Version="14.0.8" />
<PackageVersion Include="MongoDB.Extensions.Migration" Version="1.4.0" />
</ItemGroup>

</Project>
</Project>
3 changes: 1 addition & 2 deletions samples/Migration/Migration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" />
<PackageReference Include="MongoDB.Extensions.Migration" />
<ProjectReference Include="..\..\src\Migration\Migration.csproj" />
</ItemGroup>

</Project>
38 changes: 38 additions & 0 deletions samples/MongoDB.Extensions.Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand Down
5 changes: 4 additions & 1 deletion src/Context.AllowedTypes.Tests/MongoDatabaseBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public void AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success()
BsonSerializer.LookupSerializer<object>();

Assert.True(registeredSerializer is TypeObjectSerializer);
Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent());
Snapshot.Match(TestHelpers.GetTypeObjectSerializerContent(),
options => options.Assert(fieldOption =>
Assert.Contains("MongoDB", fieldOption
.Fields<string>("AllowedTypesByDependencies[*]"))));
}

[Fact]
Expand Down
3 changes: 3 additions & 0 deletions src/Context.AllowedTypes.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using Xunit;

[assembly: CollectionBehavior(DisableTestParallelization = true)]
12 changes: 8 additions & 4 deletions src/Context.AllowedTypes.Tests/TypeObjectSerializerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using Snapshooter.Xunit;
using Xunit;

[assembly: CollectionBehavior(DisableTestParallelization = true)]

namespace MongoDB.Extensions.Context.AllowedTypes.Tests;

public class TypeObjectSerializerTests
Expand All @@ -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<string>("AllowedTypesByDependencies[*]"))));
}

[Fact]
Expand Down Expand Up @@ -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<string>("AllowedTypesByDependencies[*]"))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
5 changes: 4 additions & 1 deletion src/Context.Tests/Internal/DependencyTypesResolverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>("[*]"))));
}
}
Original file line number Diff line number Diff line change
@@ -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"
]
3 changes: 3 additions & 0 deletions src/Context.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using Xunit;

[assembly: CollectionBehavior(DisableTestParallelization = true)]
7 changes: 7 additions & 0 deletions src/MongoDB.Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 6864174

Please sign in to comment.