Skip to content

Commit 6e184b4

Browse files
committed
Add XML docs and SourceLink metadata; enforce CS1591 #341
Added XML documentation comments to key public members in TestBedWithDI, OutputLogger, and OutputLoggerProvider. Updated the project file to remove suppression of CS1591 warnings, enforce documentation completeness, and include SourceLink and repository metadata for improved NuGet package quality and traceability.
1 parent 8c499f5 commit 6e184b4

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

src/Abstracts/TestBedWithDI.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ namespace Xunit.Microsoft.DependencyInjection.Abstracts;
1010
public abstract class TestBedWithDI<TFixture> : TestBed<TFixture>
1111
where TFixture : TestBedFixture
1212
{
13+
/// <summary>
14+
/// Initializes the test bed and performs property injection for members marked with <see cref="InjectAttribute"/>.
15+
/// </summary>
16+
/// <param name="testOutputHelper">The xUnit test output helper.</param>
17+
/// <param name="fixture">The fixture instance supplying services.</param>
1318
protected TestBedWithDI(ITestOutputHelper testOutputHelper, TFixture fixture)
1419
: base(testOutputHelper, fixture) =>
1520
// Resolve and inject dependencies for derived classes

src/Logging/OutputLogger.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ public OutputLogger(ITestOutputHelper testOutputHelper)
1616
{
1717
}
1818

19+
/// <summary>
20+
/// Begins a logical operation scope. Returns a disposable that performs no action.
21+
/// </summary>
1922
public IDisposable? BeginScope<TState>(TState state) where TState : notnull
2023
=> new NoOpDisposable();
2124

25+
/// <summary>
26+
/// Always returns true; all log levels are enabled for forwarding to test output.
27+
/// </summary>
2228
public bool IsEnabled(LogLevel logLevel)
2329
=> true;
2430

src/Logging/OutputLoggerProvider.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ public class OutputLoggerProvider(ITestOutputHelper testOutputHelper) : ILoggerP
88
{
99
private readonly ITestOutputHelper _testOutputHelper = testOutputHelper;
1010

11+
/// <summary>
12+
/// Creates a new <see cref="OutputLogger"/> for the specified category.
13+
/// </summary>
1114
public ILogger CreateLogger(string categoryName)
1215
=> new OutputLogger(categoryName, _testOutputHelper);
1316

17+
/// <summary>
18+
/// Disposes the provider (no-op other than suppressing finalization).
19+
/// </summary>
1420
public void Dispose() => GC.SuppressFinalize(this);
1521
}

src/Xunit.Microsoft.DependencyInjection.csproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77
<PackageReadmeFile>README.md</PackageReadmeFile>
88
<!-- Enable XML documentation output for NuGet consumers -->
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10-
<!-- Suppress warning for missing XML comments on publicly visible types if any remain -->
11-
<NoWarn>$(NoWarn);CS1591</NoWarn>
12-
<!-- Include repository URL placeholders if desired (can be updated later) -->
10+
<!-- Enforce completeness: do NOT suppress CS1591 (removed) -->
1311
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Xunit.Microsoft.DependencyInjection.xml</DocumentationFile>
12+
<!-- Repository / SourceLink metadata -->
13+
<RepositoryUrl>https://github.com/Umplify/xunit-dependency-injection</RepositoryUrl>
14+
<RepositoryType>git</RepositoryType>
15+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
16+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
17+
<IncludeSymbols>true</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
<EnableSourceLink>true</EnableSourceLink>
20+
<!-- Optional: mark builds as CI to embed commit information when built on CI -->
21+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
1422
</PropertyGroup>
1523
<ItemGroup>
1624
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
@@ -20,9 +28,12 @@
2028
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.8" />
2129
<PackageReference Include="xunit.v3.extensibility.core" Version="3.0.1" />
2230
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.8" />
31+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
2332
</ItemGroup>
2433
<ItemGroup>
2534
<None Include="..\README.md" Pack="true" PackagePath="\" />
35+
<!-- Explicitly include XML documentation file in package -->
36+
<None Include="bin\$(Configuration)\$(TargetFramework)\Xunit.Microsoft.DependencyInjection.xml" Pack="true" PackagePath="\" Condition="Exists('bin\\$(Configuration)\\$(TargetFramework)\\Xunit.Microsoft.DependencyInjection.xml')" />
2637
</ItemGroup>
2738
<ItemGroup>
2839
<Folder Include="Abstracts\" />

0 commit comments

Comments
 (0)