Updated to .Net Core 8

This commit is contained in:
UltimateCoder
2024-11-26 00:18:00 +01:00
parent e8842f8991
commit 2b0b04ec7b
28 changed files with 269 additions and 504 deletions
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="MongoDbTests" connectionString="mongodb://localhost:27017" />
</connectionStrings>
</configuration>
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>10</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="2.1.2" />
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
<PackageReference Include="MongoDB.Driver" Version="3.0.0" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.console" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
@@ -17,13 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
</ItemGroup>
<ItemGroup>
<None Update="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>
<ItemGroup>
@@ -11,10 +11,8 @@ using Xunit;
namespace CoreIntegrationTests.Infrastructure
{
public abstract partial class MongoDbDocumentTestBase<T>
where T : TestDoc, new()
public abstract partial class MongoDbDocumentTestBase<T> where T : TestDoc, new()
{
private readonly MongoDbTestFixture<T, Guid> _fixture;
protected MongoDbDocumentTestBase(MongoDbTestFixture<T, Guid> fixture)
@@ -14,8 +14,7 @@ using Xunit;
namespace CoreIntegrationTests.Infrastructure
{
public abstract partial class MongoDbDocumentTestBase<T> :
IClassFixture<MongoDbTestFixture<T, Guid>>
where T : TestDoc, new()
IClassFixture<MongoDbTestFixture<T, Guid>> where T : TestDoc, new()
{
#region Update One
@@ -40,7 +40,7 @@ namespace CoreIntegrationTests.Infrastructure
public class TestDoc : Document
{
public TestDoc()
protected TestDoc()
{
Version = 2;
Nested = new Nested
@@ -12,7 +12,7 @@ namespace CoreIntegrationTests.Infrastructure
public class TestTKeyRepository<TKey> : BaseMongoRepository<TKey>, ITestRepository<TKey> where TKey : IEquatable<TKey>
{
const string connectionString = "mongodb://localhost:27017/MongoDbTests";
const string connectionString = "mongodb://test:Test123!@10.0.3.4:27017/MongoDbTests";
private static readonly ITestRepository<TKey> _instance = new TestTKeyRepository<TKey>(connectionString);
/// <inheritdoc />
private TestTKeyRepository(string connectionString) : base(connectionString)
@@ -44,7 +44,7 @@ namespace CoreIntegrationTests.Infrastructure
public sealed class TestRepository : BaseMongoRepository, ITestRepository
{
const string connectionString = "mongodb://localhost:27017";
const string connectionString = "mongodb://test:Test123!@10.0.3.4:27017";
private static readonly ITestRepository _instance = new TestRepository(connectionString, "MongoDbTests");
// Explicit static constructor to tell C# compiler