diff --git a/.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt b/.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt index 54c14f6..9ced0dc 100644 --- a/.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt @@ -1,4 +1,10 @@ -Version 9.1.2 +Version 9.1.3 +Availability: .NET 9 and .NET 8 +  +# ALM +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +Version 9.1.2 Availability: .NET 9 and .NET 8   # ALM diff --git a/.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt b/.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt index 8bf2702..ddb6bd8 100644 --- a/.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt @@ -1,4 +1,13 @@ -Version 9.1.2 +Version 9.1.3 +Availability: .NET 9 and .NET 8 +  +# ALM +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +# Improvements +- CHANGED AspNetCoreHostTest class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace to include the IWebHostTest interface +  +Version 9.1.2 Availability: .NET 9 and .NET 8   # ALM diff --git a/.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt b/.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt index d682549..009a197 100644 --- a/.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt @@ -1,4 +1,16 @@ -Version 9.1.2 +Version 9.1.3 +Availability: .NET 9, .NET 8 and .NET Standard 2.0 +  +# ALM +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +# Bug Fixes +- FIXED IGenericHostTest interface in the Codebelt.Extensions.Xunit.Hosting namespace to include the IHostTest interface +  +# Improvements +- CHANGED HostTest class in the Codebelt.Extensions.Xunit.Hosting namespace to include IGenericHostTest interface +  +Version 9.1.2 Availability: .NET 9, .NET 8 and .NET Standard 2.0   # ALM diff --git a/.nuget/Codebelt.Extensions.Xunit.Hosting/README.md b/.nuget/Codebelt.Extensions.Xunit.Hosting/README.md index 0164076..4f1d6f8 100644 --- a/.nuget/Codebelt.Extensions.Xunit.Hosting/README.md +++ b/.nuget/Codebelt.Extensions.Xunit.Hosting/README.md @@ -21,14 +21,12 @@ More documentation available at our documentation site: ### CSharp Example -Source: [AspNetCoreHostTestTest.cs](https://github.com/codebeltnet/xunit/tree/main/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs) - ```csharp -public class AspNetCoreHostTestTest : AspNetCoreHostTest +public class HostTestTest : HostTest { private readonly IServiceProvider _provider; - public AspNetCoreHostTestTest(AspNetCoreHostFixture hostFixture, ITestOutputHelper output) : base(hostFixture, output) + public HostTestTest(HostFixture hostFixture, ITestOutputHelper output) : base(hostFixture, output) { _provider = hostFixture.ServiceProvider; _provider.GetRequiredService().TestOutput = output; @@ -43,3 +41,5 @@ public class AspNetCoreHostTestTest : AspNetCoreHostTest } } ``` + +A similar but real life example can be found here: [AspNetCoreHostTestTest.cs](https://github.com/codebeltnet/xunit/tree/main/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs) diff --git a/.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt b/.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt index 6553af1..20c1c73 100644 --- a/.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt @@ -1,4 +1,10 @@ -Version 9.1.2 +Version 9.1.3 +Availability: .NET 9 and .NET 8 +  +# ALM +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +Version 9.1.2 Availability: .NET 9, .NET 8 and .NET Standard 2.0   # ALM diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e9a8d..2aa5727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ For more details, please refer to `PackageReleaseNotes.txt` on a per assembly ba > [!NOTE] > Changelog entries prior to version 8.4.0 was migrated from previous versions of Cuemon.Extensions.Xunit, Cuemon.Extensions.Xunit.Hosting, and Cuemon.Extensions.Xunit.Hosting.AspNetCore. +## [9.1.3] - 2025-04-03 + +### Fixed + +- IGenericHostTest interface in the Codebelt.Extensions.Xunit.Hosting namespace to include the IHostTest interface + +### Changed + +- HostTest class in the Codebelt.Extensions.Xunit.Hosting namespace to include the IGenericHostTest interface +- AspNetCoreHostTest class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace to include the IWebHostTest interface + ## [9.1.2] - 2025-04-03 ### Fixed diff --git a/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs b/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs index 30ec17a..005c2ad 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs @@ -11,7 +11,7 @@ namespace Codebelt.Extensions.Xunit.Hosting.AspNetCore /// The type of the object that implements the interface. /// /// - public abstract class AspNetCoreHostTest : HostTest where T : class, IAspNetCoreHostFixture + public abstract class AspNetCoreHostTest : HostTest, IWebHostTest where T : class, IAspNetCoreHostFixture { /// /// Initializes a new instance of the class. diff --git a/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IWebHostTest.cs b/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IWebHostTest.cs index 085336a..d8ecf39 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IWebHostTest.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/IWebHostTest.cs @@ -5,8 +5,7 @@ /// /// /// - /// - public interface IWebHostTest : IGenericHostTest, IPipelineTest, IHostTest + public interface IWebHostTest : IGenericHostTest, IPipelineTest { } } diff --git a/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs b/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs index a0cb6f7..dcc7a50 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs @@ -5,7 +5,7 @@ namespace Codebelt.Extensions.Xunit.Hosting.AspNetCore { - internal sealed class WebHostTest : AspNetCoreHostTest, IWebHostTest + internal sealed class WebHostTest : AspNetCoreHostTest { private readonly Action _pipelineConfigurator; private readonly Action _serviceConfigurator; diff --git a/src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs b/src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs index 227b483..cfae46d 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs @@ -4,7 +4,7 @@ namespace Codebelt.Extensions.Xunit.Hosting { - internal sealed class GenericHostTest : HostTest, IGenericHostTest + internal sealed class GenericHostTest : HostTest { private readonly Action _serviceConfigurator; private readonly Action _serviceConfiguratorWithContext; diff --git a/src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs b/src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs index 0a9a0b2..fc46033 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs @@ -14,7 +14,7 @@ namespace Codebelt.Extensions.Xunit.Hosting /// /// /// The class needed to be designed in this rather complex way, as this is the only way that xUnit supports a shared context. The need for shared context is theoretical at best, but it does opt-in for Scoped instances. - public abstract class HostTest : Test, IClassFixture where T : class, IHostFixture + public abstract class HostTest : Test, IGenericHostTest, IClassFixture where T : class, IHostFixture { /// /// Initializes a new instance of the class. diff --git a/src/Codebelt.Extensions.Xunit.Hosting/IGenericHostTest.cs b/src/Codebelt.Extensions.Xunit.Hosting/IGenericHostTest.cs index 565d376..d833639 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting/IGenericHostTest.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting/IGenericHostTest.cs @@ -9,7 +9,8 @@ namespace Codebelt.Extensions.Xunit.Hosting /// /// /// - public interface IGenericHostTest : IServiceTest, IConfigurationTest, IHostingEnvironmentTest, ITest + /// + public interface IGenericHostTest : IServiceTest, IConfigurationTest, IHostingEnvironmentTest, ITest, IHostTest { } } diff --git a/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs b/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs index 07fb254..1dd81c9 100644 --- a/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs +++ b/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs @@ -125,6 +125,22 @@ public void ShouldLogToXunitTestLogging() Assert.Equal("Information: Hello from ShouldLogToXunitTestLogging", entry.Message); } + [Fact] + public void Test_VerifyAbstractions() + { + using var hostTest = WebHostTestFactory.Create(hostFixture: null); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + } + public override void ConfigureApplication(IApplicationBuilder app) { app.ApplicationServices.GetRequiredService>().LogInformation(nameof(ConfigureApplication)); diff --git a/test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs b/test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs index 5f89a32..bba8492 100644 --- a/test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs +++ b/test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs @@ -63,6 +63,20 @@ public void Test_ShouldHaveEnvironmentOfDevelopment() Assert.Equal("Development", HostingEnvironment.EnvironmentName); } + [Fact] + public void Test_VerifyAbstractions() + { + using var hostTest = GenericHostTestFactory.Create(hostFixture: null); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + Assert.IsAssignableFrom(hostTest); + } + protected override void OnDisposeManagedResources() { _scope?.Dispose();