Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.5.0",
"version": "5.5.9",
"commands": [
"reportgenerator"
],
Expand Down
407 changes: 256 additions & 151 deletions .editorconfig

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HotChocolate.AspNetCore" Version="15.1.11" />
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="15.1.11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="HotChocolate.AspNetCore" Version="16.0.0"/>
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="16.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1"/>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.7"/>
<PackageReference Include="NSubstitute" Version="5.3.0"/>
<PackageReference Include="System.Text.Json" Version="10.0.7"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PackageReference Include="coverlet.msbuild" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Snapshooter.Xunit" Version="1.0.1" />
<PackageReference Include="Snapshooter.Xunit" Version="1.3.1"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GraphHealthChecks\GraphHealthChecks.csproj" />
<ProjectReference Include="..\GraphHealthChecks\GraphHealthChecks.csproj"/>
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions GraphHealthChecks.Tests/GraphHealthChecksFactoriesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void GraphHealthCheckFactoryWithNoLoggerCustomSchema()
.BuildServiceProvider()
);

Assert.IsAssignableFrom<GraphHealthCheck>(result);
Assert.IsType<GraphHealthCheck>(result, exactMatch: false);
Assert.Equal("schema", (result as GraphHealthCheck)?.Schema);
}

Expand All @@ -30,7 +30,7 @@ public void GraphHealthCheckFactoryWithNoLoggerDefaultSchema()
.BuildServiceProvider()
);

Assert.IsAssignableFrom<GraphHealthCheck>(result);
Assert.IsType<GraphHealthCheck>(result, exactMatch: false);
Assert.Null((result as GraphHealthCheck)?.Schema);
}

Expand All @@ -46,7 +46,7 @@ public void GraphHealthCheckFactoryWithILoggerCustomSchema()
.BuildServiceProvider()
);

Assert.IsAssignableFrom<GraphHealthCheck>(result);
Assert.IsType<GraphHealthCheck>(result, exactMatch: false);
Assert.Equal("schema", (result as GraphHealthCheck)?.Schema);
}

Expand All @@ -62,7 +62,7 @@ public void GraphHealthCheckFactoryWithILoggerDefaultSchema()
.BuildServiceProvider()
);

Assert.IsAssignableFrom<GraphHealthCheck>(result);
Assert.IsType<GraphHealthCheck>(result, exactMatch: false);
Assert.Null((result as GraphHealthCheck)?.Schema);
}

Expand All @@ -78,7 +78,7 @@ public void GraphHealthCheckFactoryWithLoggerFnCustomSchema()
.BuildServiceProvider()
);

Assert.IsAssignableFrom<GraphHealthCheck>(result);
Assert.IsType<GraphHealthCheck>(result, exactMatch: false);
Assert.Equal("schema", (result as GraphHealthCheck)?.Schema);
}

Expand All @@ -94,12 +94,12 @@ public void GraphHealthCheckFactoryWithLoggerFnDefaultSchema()
.BuildServiceProvider()
);

Assert.IsAssignableFrom<GraphHealthCheck>(result);
Assert.IsType<GraphHealthCheck>(result, exactMatch: false);
Assert.Null((result as GraphHealthCheck)?.Schema);
}

public class Query
{
public string Name => "Hello";
}
}
}
42 changes: 14 additions & 28 deletions GraphHealthChecks.Tests/GraphHealthExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ namespace GraphHealthChecks.Tests;

public class GraphHealthExtensionsTests
{
private static readonly string[] _schemas =
[
"health1",
"health2",
"health3",
"health4",
"health5",
"health6"
];

[Fact(DisplayName = "AddGraphHealth - Multiple Instances - Separate Names and Schemas")]
public void MultipleInstancesSeparateNamesAndSchemas()
{
Expand All @@ -26,15 +36,7 @@ public void MultipleInstancesSeparateNamesAndSchemas()

Assert.Equal(
options.Registrations.Count,
new[]
{
"health1",
"health2",
"health3",
"health4",
"health5",
"health6"
}
_schemas
.Intersect(options.Registrations.Select(x => x.Name))
.Distinct()
.Count()
Expand All @@ -61,15 +63,7 @@ public void MultipleInstancesSeparateNamesAndSameSchema()

Assert.Equal(
options.Registrations.Count,
new[]
{
"health1",
"health2",
"health3",
"health4",
"health5",
"health6"
}
_schemas
.Intersect(options.Registrations.Select(x => x.Name))
.Distinct()
.Count()
Expand All @@ -96,15 +90,7 @@ public void MultipleInstancesSeparateNamesAndSameSchemaDefault()

Assert.Equal(
options.Registrations.Count,
new[]
{
"health1",
"health2",
"health3",
"health4",
"health5",
"health6"
}
_schemas
.Intersect(options.Registrations.Select(x => x.Name))
.Distinct()
.Count()
Expand Down Expand Up @@ -294,4 +280,4 @@ public void AddGraphHealthWithILoggerFactoryCustomHealthName()
.Count()
);
}
}
}
Loading
Loading