diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 1903d86..96b7185 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
- "version": "5.4.3",
+ "version": "5.5.0",
"commands": [
"reportgenerator"
],
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 0b821fe..16cd3f4 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -22,6 +22,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
diff --git a/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj b/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj
index 4f5f1c1..73596ac 100644
--- a/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj
+++ b/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj
@@ -1,36 +1,34 @@
-
- net8.0;net9.0
- enable
- enable
- false
- true
-
+
+ net8.0;net9.0;net10.0
+ enable
+ enable
+ false
+ true
+
-
-
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
-
-
-
+
+
+
diff --git a/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs b/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs
index 89ca40c..a302c5a 100644
--- a/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs
+++ b/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs
@@ -3,6 +3,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
+using NSubstitute.ExceptionExtensions;
using Snapshooter.Xunit;
namespace GraphHealthChecks.Tests;
@@ -24,12 +25,12 @@ private static object GetErrorResult(HealthCheckResult result) =>
[Fact(DisplayName = "GraphQLHealthCheck - No Logger - Unhealthy Schema")]
public async Task NoLoggerUnhealthySchema()
{
- var mockRequestExecutorResolver = new Mock();
+ var mockRequestExecutorResolver = Substitute.For();
mockRequestExecutorResolver
- .Setup(m => m.GetRequestExecutorAsync(It.IsAny(), It.IsAny()))
- .ThrowsAsync(new SchemaException());
+ .GetRequestExecutorAsync(Arg.Any(), Arg.Any())
+ .Throws(new SchemaException());
- var result = await new GraphHealthCheck(mockRequestExecutorResolver.Object)
+ var result = await new GraphHealthCheck(mockRequestExecutorResolver)
.CheckHealthAsync(null!);
Assert.Equal(HealthStatus.Unhealthy, result.Status);
@@ -41,12 +42,12 @@ public async Task NoLoggerUnhealthySchema()
[Fact(DisplayName = "GraphQLHealthCheck - No Logger - General Error")]
public async Task NoLoggerGeneralError()
{
- var mockRequestExecutorResolver = new Mock();
+ var mockRequestExecutorResolver = Substitute.For();
mockRequestExecutorResolver
- .Setup(m => m.GetRequestExecutorAsync(It.IsAny(), It.IsAny()))
- .ThrowsAsync(new Exception("Splash!"));
+ .GetRequestExecutorAsync(Arg.Any(), Arg.Any())
+ .Throws(new Exception("Splash!"));
- var result = await new GraphHealthCheck(mockRequestExecutorResolver.Object).CheckHealthAsync(null!);
+ var result = await new GraphHealthCheck(mockRequestExecutorResolver).CheckHealthAsync(null!);
Assert.Equal(HealthStatus.Unhealthy, result.Status);
Assert.IsAssignableFrom(result.Exception);
@@ -76,15 +77,15 @@ public async Task NoLoggerHealthy()
[Fact(DisplayName = "GraphQLHealthCheck - ILogger - General Error")]
public async Task ILoggerGeneralError()
{
- var mockLogger = new Mock>();
- var mockResolver = new Mock();
+ var mockLogger = Substitute.For>();
+ var mockResolver = Substitute.For();
mockResolver
- .Setup(m => m.GetRequestExecutorAsync(It.IsAny(), It.IsAny()))
- .ThrowsAsync(new Exception("Splash!"));
+ .GetRequestExecutorAsync(Arg.Any(), Arg.Any())
+ .Throws(new Exception("Splash!"));
var result = await new GraphHealthCheck(
- mockResolver.Object,
- mockLogger.Object
+ mockResolver,
+ mockLogger
)
.CheckHealthAsync(null!);
@@ -93,7 +94,13 @@ public async Task ILoggerGeneralError()
Assert.NotNull(result.Description);
Assert.Contains("general", result.Description);
- mockLogger.VerifyLog(m => m.LogError(It.IsAny(), It.IsAny(), It.IsAny