From 8165a7bbe1c98373f110e9f5856bc0e6a9747e6d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 13:48:33 +0000 Subject: [PATCH 1/4] fix: enable Allure test reporting and fix artifact download - Replace [Fact] with [AllureXunit] attribute in all 33 test files (313 tests) to enable Allure.Xunit to capture test results - Add global using for Allure.Xunit.Attributes in tests/Directory.Build.props - Fix artifact download by using dawidd6/action-download-artifact@v6 which can download artifacts from previous workflow runs, not just the current run. This fixes the "Artifact not found for name: allure-history" error that occurs on first run or when artifact is expired. --- .github/workflows/ci.yaml | 5 +- tests/Directory.Build.props | 5 ++ .../ConfigurationOptionsTests.cs | 16 +++---- .../ErrorResponseTests.cs | 18 +++---- .../GlobalExceptionHandlerMiddlewareTests.cs | 24 +++++----- .../HealthCheckModelsTests.cs | 30 ++++++------ .../HealthCheckServiceTests.cs | 24 +++++----- .../LevelServiceExtensionsTests.cs | 26 +++++----- .../ProgramTests.cs | 30 ++++++------ .../ServiceConfigurationExtensionsTests.cs | 24 +++++----- .../SwaggerConfigurationExtensionsTests.cs | 48 +++++++++---------- .../TheOfficeApiIntegrationTests.cs | 16 +++---- .../ApiRequestTests.cs | 10 ++-- .../ApiResponseTests.cs | 12 ++--- .../EpisodeTests.cs | 12 ++--- .../HealthControllerTests.cs | 16 +++---- .../Level0ControllerTests.cs | 18 +++---- .../SeasonTests.cs | 8 ++-- .../TheOfficeServiceTests.cs | 14 +++--- .../TheOfficeApiIntegrationTests.cs | 16 +++---- .../EpisodesControllerTests.cs | 16 +++---- .../HealthControllerTests.cs | 16 +++---- .../SeasonsControllerTests.cs | 6 +-- .../TheOfficeApiIntegrationTests.cs | 22 ++++----- .../EpisodesControllerTests.cs | 20 ++++---- .../HealthControllerTests.cs | 16 +++---- .../SeasonsControllerTests.cs | 14 +++--- .../TheOfficeApiIntegrationTests.cs | 34 ++++++------- .../EpisodesControllerTests.cs | 20 ++++---- .../HealthControllerTests.cs | 16 +++---- .../SeasonsControllerTests.cs | 16 +++---- .../TheOfficeAPI.Tests.E2E/Level0E2ETests.cs | 12 ++--- .../TheOfficeAPI.Tests.E2E/Level1E2ETests.cs | 12 ++--- .../TheOfficeAPI.Tests.E2E/Level2E2ETests.cs | 20 ++++---- .../TheOfficeAPI.Tests.E2E/Level3E2ETests.cs | 24 +++++----- 35 files changed, 322 insertions(+), 314 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d9d6c2..54e19fe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -76,11 +76,14 @@ jobs: echo "Total: $(ls -1 allure-results 2>/dev/null | wc -l) files" - name: Download previous Allure history - uses: actions/download-artifact@v4 + uses: dawidd6/action-download-artifact@v6 if: always() with: + workflow: ci.yaml name: allure-history path: allure-history + if_no_artifact_found: warn + search_artifacts: true continue-on-error: true - name: Install Allure CLI diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 5cd6820..8c75439 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,4 +1,9 @@ + + + + + diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs index 9a76e62..af01119 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs @@ -4,14 +4,14 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class ConfigurationOptionsTests { - [Fact] + [AllureXunit] public void EnvironmentOptions_SectionName_ReturnsEnvironment() { // Assert Assert.Equal("Environment", EnvironmentOptions.SectionName); } - [Fact] + [AllureXunit] public void EnvironmentOptions_MaturityLevelVariable_DefaultsToEmptyString() { // Arrange @@ -21,7 +21,7 @@ public void EnvironmentOptions_MaturityLevelVariable_DefaultsToEmptyString() Assert.Equal(string.Empty, options.MaturityLevelVariable); } - [Fact] + [AllureXunit] public void EnvironmentOptions_MaturityLevelVariable_CanBeSet() { // Arrange @@ -34,14 +34,14 @@ public void EnvironmentOptions_MaturityLevelVariable_CanBeSet() Assert.Equal("CUSTOM_MATURITY_LEVEL", options.MaturityLevelVariable); } - [Fact] + [AllureXunit] public void ServerOptions_SectionName_ReturnsServer() { // Assert Assert.Equal("Server", ServerOptions.SectionName); } - [Fact] + [AllureXunit] public void ServerOptions_DefaultUrl_DefaultsToEmptyString() { // Arrange @@ -51,7 +51,7 @@ public void ServerOptions_DefaultUrl_DefaultsToEmptyString() Assert.Equal(string.Empty, options.DefaultUrl); } - [Fact] + [AllureXunit] public void ServerOptions_DefaultUrl_CanBeSet() { // Arrange @@ -64,7 +64,7 @@ public void ServerOptions_DefaultUrl_CanBeSet() Assert.Equal("http://localhost:5000", options.DefaultUrl); } - [Fact] + [AllureXunit] public void EnvironmentOptions_IsInstantiable() { // Act @@ -74,7 +74,7 @@ public void EnvironmentOptions_IsInstantiable() Assert.NotNull(options); } - [Fact] + [AllureXunit] public void ServerOptions_IsInstantiable() { // Act diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs index a07be59..487536e 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class ErrorResponseTests { - [Fact] + [AllureXunit] public void ErrorResponse_DefaultConstructor_SetsDefaultValues() { // Act @@ -19,7 +19,7 @@ public void ErrorResponse_DefaultConstructor_SetsDefaultValues() Assert.Null(errorResponse.TraceId); } - [Fact] + [AllureXunit] public void ErrorResponse_TimestampIsSetToUtcNow() { // Arrange @@ -34,7 +34,7 @@ public void ErrorResponse_TimestampIsSetToUtcNow() Assert.True(errorResponse.Timestamp <= afterCreation); } - [Fact] + [AllureXunit] public void ErrorResponse_CanSetStatusCode() { // Arrange @@ -47,7 +47,7 @@ public void ErrorResponse_CanSetStatusCode() Assert.Equal(404, errorResponse.StatusCode); } - [Fact] + [AllureXunit] public void ErrorResponse_CanSetMessage() { // Arrange @@ -60,7 +60,7 @@ public void ErrorResponse_CanSetMessage() Assert.Equal("Not Found", errorResponse.Message); } - [Fact] + [AllureXunit] public void ErrorResponse_CanSetDetails() { // Arrange @@ -73,7 +73,7 @@ public void ErrorResponse_CanSetDetails() Assert.Equal("Resource with ID 123 was not found", errorResponse.Details); } - [Fact] + [AllureXunit] public void ErrorResponse_CanSetPath() { // Arrange @@ -86,7 +86,7 @@ public void ErrorResponse_CanSetPath() Assert.Equal("/api/v1/test", errorResponse.Path); } - [Fact] + [AllureXunit] public void ErrorResponse_CanSetTraceId() { // Arrange @@ -99,7 +99,7 @@ public void ErrorResponse_CanSetTraceId() Assert.Equal("trace-123", errorResponse.TraceId); } - [Fact] + [AllureXunit] public void ErrorResponse_CanSetTimestamp() { // Arrange @@ -113,7 +113,7 @@ public void ErrorResponse_CanSetTimestamp() Assert.Equal(customTimestamp, errorResponse.Timestamp); } - [Fact] + [AllureXunit] public void ErrorResponse_AllPropertiesCanBeSet() { // Arrange & Act diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs index 037b25d..31b134b 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs @@ -23,7 +23,7 @@ public GlobalExceptionHandlerMiddlewareTests() _httpContext.Response.Body = new MemoryStream(); } - [Fact] + [AllureXunit] public async Task InvokeAsync_NoException_CallsNext() { // Arrange @@ -43,7 +43,7 @@ public async Task InvokeAsync_NoException_CallsNext() Assert.True(nextCalled); } - [Fact] + [AllureXunit] public async Task InvokeAsync_ArgumentNullException_ReturnsBadRequest() { // Arrange @@ -70,7 +70,7 @@ public async Task InvokeAsync_ArgumentNullException_ReturnsBadRequest() Assert.Equal("Invalid request parameters", errorResponse.Message); } - [Fact] + [AllureXunit] public async Task InvokeAsync_ArgumentException_ReturnsBadRequest() { // Arrange @@ -97,7 +97,7 @@ public async Task InvokeAsync_ArgumentException_ReturnsBadRequest() Assert.Equal("Invalid argument", errorResponse.Details); } - [Fact] + [AllureXunit] public async Task InvokeAsync_KeyNotFoundException_ReturnsNotFound() { // Arrange @@ -124,7 +124,7 @@ public async Task InvokeAsync_KeyNotFoundException_ReturnsNotFound() Assert.Equal("Resource not found", errorResponse.Details); } - [Fact] + [AllureXunit] public async Task InvokeAsync_UnauthorizedAccessException_ReturnsUnauthorized() { // Arrange @@ -150,7 +150,7 @@ public async Task InvokeAsync_UnauthorizedAccessException_ReturnsUnauthorized() Assert.Equal("Unauthorized access", errorResponse.Message); } - [Fact] + [AllureXunit] public async Task InvokeAsync_InvalidOperationException_ReturnsConflict() { // Arrange @@ -177,7 +177,7 @@ public async Task InvokeAsync_InvalidOperationException_ReturnsConflict() Assert.Equal("Invalid state", errorResponse.Details); } - [Fact] + [AllureXunit] public async Task InvokeAsync_NotImplementedException_ReturnsNotImplemented() { // Arrange @@ -203,7 +203,7 @@ public async Task InvokeAsync_NotImplementedException_ReturnsNotImplemented() Assert.Equal("This functionality is not yet implemented", errorResponse.Message); } - [Fact] + [AllureXunit] public async Task InvokeAsync_TimeoutException_ReturnsRequestTimeout() { // Arrange @@ -229,7 +229,7 @@ public async Task InvokeAsync_TimeoutException_ReturnsRequestTimeout() Assert.Equal("The request timed out", errorResponse.Message); } - [Fact] + [AllureXunit] public async Task InvokeAsync_GenericException_ReturnsInternalServerError() { // Arrange @@ -256,7 +256,7 @@ public async Task InvokeAsync_GenericException_ReturnsInternalServerError() Assert.Null(errorResponse.Details); // No details in production } - [Fact] + [AllureXunit] public async Task InvokeAsync_DevelopmentEnvironment_IncludesDetailedErrors() { // Arrange @@ -280,7 +280,7 @@ public async Task InvokeAsync_DevelopmentEnvironment_IncludesDetailedErrors() Assert.Contains("Detailed error", errorResponse.Details); } - [Fact] + [AllureXunit] public async Task InvokeAsync_SetsTraceIdAndPath() { // Arrange @@ -307,7 +307,7 @@ public async Task InvokeAsync_SetsTraceIdAndPath() Assert.Equal("test-trace-id", errorResponse.TraceId); } - [Fact] + [AllureXunit] public async Task InvokeAsync_LogsException() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs index 8738ea7..8b2371b 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class HealthCheckModelsTests { - [Fact] + [AllureXunit] public void HealthStatus_HasExpectedValues() { // Assert @@ -13,7 +13,7 @@ public void HealthStatus_HasExpectedValues() Assert.Equal(2, (int)HealthStatus.Unhealthy); } - [Fact] + [AllureXunit] public void HealthCheckResponse_DefaultConstructor_SetsDefaultValues() { // Act @@ -25,7 +25,7 @@ public void HealthCheckResponse_DefaultConstructor_SetsDefaultValues() Assert.Null(response.Message); } - [Fact] + [AllureXunit] public void HealthCheckResponse_TimestampIsSetToUtcNow() { // Arrange @@ -40,7 +40,7 @@ public void HealthCheckResponse_TimestampIsSetToUtcNow() Assert.True(response.Timestamp <= afterCreation); } - [Fact] + [AllureXunit] public void HealthCheckResponse_CanSetStatus() { // Arrange @@ -53,7 +53,7 @@ public void HealthCheckResponse_CanSetStatus() Assert.Equal("Unhealthy", response.Status); } - [Fact] + [AllureXunit] public void HealthCheckResponse_CanSetMessage() { // Arrange @@ -66,7 +66,7 @@ public void HealthCheckResponse_CanSetMessage() Assert.Equal("Test message", response.Message); } - [Fact] + [AllureXunit] public void DetailedHealthCheckResponse_DefaultConstructor_SetsDefaultValues() { // Act @@ -82,7 +82,7 @@ public void DetailedHealthCheckResponse_DefaultConstructor_SetsDefaultValues() Assert.Equal("1.0.0", response.Version); } - [Fact] + [AllureXunit] public void DetailedHealthCheckResponse_CanSetComponents() { // Arrange @@ -100,7 +100,7 @@ public void DetailedHealthCheckResponse_CanSetComponents() Assert.True(response.Components.ContainsKey("database")); } - [Fact] + [AllureXunit] public void DetailedHealthCheckResponse_CanSetUptime() { // Arrange @@ -114,7 +114,7 @@ public void DetailedHealthCheckResponse_CanSetUptime() Assert.Equal(uptime, response.Uptime); } - [Fact] + [AllureXunit] public void DetailedHealthCheckResponse_CanSetVersion() { // Arrange @@ -127,7 +127,7 @@ public void DetailedHealthCheckResponse_CanSetVersion() Assert.Equal("2.0.0", response.Version); } - [Fact] + [AllureXunit] public void ComponentHealth_DefaultConstructor_SetsDefaultValues() { // Act @@ -139,7 +139,7 @@ public void ComponentHealth_DefaultConstructor_SetsDefaultValues() Assert.Null(component.Data); } - [Fact] + [AllureXunit] public void ComponentHealth_CanSetStatus() { // Arrange @@ -152,7 +152,7 @@ public void ComponentHealth_CanSetStatus() Assert.Equal("Degraded", component.Status); } - [Fact] + [AllureXunit] public void ComponentHealth_CanSetDescription() { // Arrange @@ -165,7 +165,7 @@ public void ComponentHealth_CanSetDescription() Assert.Equal("Database connection pool is at 90%", component.Description); } - [Fact] + [AllureXunit] public void ComponentHealth_CanSetData() { // Arrange @@ -185,7 +185,7 @@ public void ComponentHealth_CanSetData() Assert.Equal(90, component.Data["connections"]); } - [Fact] + [AllureXunit] public void DetailedHealthCheckResponse_InheritsFromHealthCheckResponse() { // Arrange & Act @@ -202,7 +202,7 @@ public void DetailedHealthCheckResponse_InheritsFromHealthCheckResponse() Assert.Equal("All systems operational", baseResponse.Message); } - [Fact] + [AllureXunit] public void ComponentHealth_AllPropertiesCanBeSet() { // Arrange & Act diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs index 0389f67..9e1baf0 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class HealthCheckServiceTests { - [Fact] + [AllureXunit] public void GetLivenessStatus_ReturnsHealthyStatus() { // Arrange @@ -20,7 +20,7 @@ public void GetLivenessStatus_ReturnsHealthyStatus() Assert.True(result.Timestamp <= DateTime.UtcNow); } - [Fact] + [AllureXunit] public void GetLivenessStatus_ReturnsCurrentTimestamp() { // Arrange @@ -36,7 +36,7 @@ public void GetLivenessStatus_ReturnsCurrentTimestamp() Assert.True(result.Timestamp <= afterCall); } - [Fact] + [AllureXunit] public void GetHealthStatus_ReturnsHealthyStatus() { // Arrange @@ -52,7 +52,7 @@ public void GetHealthStatus_ReturnsHealthyStatus() Assert.True(result.Timestamp <= DateTime.UtcNow); } - [Fact] + [AllureXunit] public void GetReadinessStatus_ReturnsDetailedHealthStatus() { // Arrange @@ -68,7 +68,7 @@ public void GetReadinessStatus_ReturnsDetailedHealthStatus() Assert.True(result.Timestamp <= DateTime.UtcNow); } - [Fact] + [AllureXunit] public void GetReadinessStatus_IncludesVersion() { // Arrange @@ -82,7 +82,7 @@ public void GetReadinessStatus_IncludesVersion() Assert.NotEmpty(result.Version); } - [Fact] + [AllureXunit] public void GetReadinessStatus_IncludesUptime() { // Arrange @@ -97,7 +97,7 @@ public void GetReadinessStatus_IncludesUptime() Assert.True(result.Uptime < TimeSpan.FromMinutes(1)); // Should be recent } - [Fact] + [AllureXunit] public void GetReadinessStatus_IncludesApplicationComponent() { // Arrange @@ -118,7 +118,7 @@ public void GetReadinessStatus_IncludesApplicationComponent() Assert.True(appComponent.Data.ContainsKey("uptime")); } - [Fact] + [AllureXunit] public void GetReadinessStatus_IncludesDataServiceComponent() { // Arrange @@ -141,7 +141,7 @@ public void GetReadinessStatus_IncludesDataServiceComponent() Assert.Equal(true, dataComponent.Data["initialized"]); } - [Fact] + [AllureXunit] public void GetReadinessStatus_UptimeIncreasesOverTime() { // Arrange @@ -156,7 +156,7 @@ public void GetReadinessStatus_UptimeIncreasesOverTime() Assert.True(result2.Uptime > result1.Uptime); } - [Fact] + [AllureXunit] public void MultipleInstances_HaveIndependentStartTimes() { // Arrange & Act @@ -171,7 +171,7 @@ public void MultipleInstances_HaveIndependentStartTimes() Assert.True(result1.Uptime > result2.Uptime); } - [Fact] + [AllureXunit] public void GetHealthStatus_ReturnsCurrentTimestamp() { // Arrange @@ -187,7 +187,7 @@ public void GetHealthStatus_ReturnsCurrentTimestamp() Assert.True(result.Timestamp <= afterCall); } - [Fact] + [AllureXunit] public void GetReadinessStatus_ReturnsCurrentTimestamp() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs index 8af25e3..1096e46 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs @@ -8,7 +8,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class LevelServiceExtensionsTests { - [Fact] + [AllureXunit] public void AddLevel0Services_RegistersTheOfficeService() { // Arrange @@ -23,7 +23,7 @@ public void AddLevel0Services_RegistersTheOfficeService() Assert.NotNull(service); } - [Fact] + [AllureXunit] public void AddLevel0Services_ReturnsServiceCollection() { // Arrange @@ -36,7 +36,7 @@ public void AddLevel0Services_ReturnsServiceCollection() Assert.Same(services, result); } - [Fact] + [AllureXunit] public void AddLevel1Services_RegistersTheOfficeService() { // Arrange @@ -51,7 +51,7 @@ public void AddLevel1Services_RegistersTheOfficeService() Assert.NotNull(service); } - [Fact] + [AllureXunit] public void AddLevel1Services_ReturnsServiceCollection() { // Arrange @@ -64,7 +64,7 @@ public void AddLevel1Services_ReturnsServiceCollection() Assert.Same(services, result); } - [Fact] + [AllureXunit] public void AddLevel2Services_RegistersTheOfficeService() { // Arrange @@ -79,7 +79,7 @@ public void AddLevel2Services_RegistersTheOfficeService() Assert.NotNull(service); } - [Fact] + [AllureXunit] public void AddLevel2Services_ReturnsServiceCollection() { // Arrange @@ -92,7 +92,7 @@ public void AddLevel2Services_ReturnsServiceCollection() Assert.Same(services, result); } - [Fact] + [AllureXunit] public void AddLevel3Services_RegistersTheOfficeService() { // Arrange @@ -107,7 +107,7 @@ public void AddLevel3Services_RegistersTheOfficeService() Assert.NotNull(service); } - [Fact] + [AllureXunit] public void AddLevel3Services_ReturnsServiceCollection() { // Arrange @@ -120,7 +120,7 @@ public void AddLevel3Services_ReturnsServiceCollection() Assert.Same(services, result); } - [Fact] + [AllureXunit] public void AllLevelServices_CanBeRegisteredTogether() { // Arrange @@ -146,7 +146,7 @@ public void AllLevelServices_CanBeRegisteredTogether() Assert.NotNull(service3); } - [Fact] + [AllureXunit] public void Level0Service_IsSingleton() { // Arrange @@ -162,7 +162,7 @@ public void Level0Service_IsSingleton() Assert.Same(service1, service2); } - [Fact] + [AllureXunit] public void Level1Service_IsSingleton() { // Arrange @@ -178,7 +178,7 @@ public void Level1Service_IsSingleton() Assert.Same(service1, service2); } - [Fact] + [AllureXunit] public void Level2Service_IsSingleton() { // Arrange @@ -194,7 +194,7 @@ public void Level2Service_IsSingleton() Assert.Same(service1, service2); } - [Fact] + [AllureXunit] public void Level3Service_IsSingleton() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs index 2b2042a..b85d8b6 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs @@ -21,7 +21,7 @@ private void SetEnvironmentVariable(string name, string? value) Environment.SetEnvironmentVariable(name, value); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithNoMaturityLevel_ReturnsWebApplication() { // Arrange @@ -35,7 +35,7 @@ public void CreateWebApplication_WithNoMaturityLevel_ReturnsWebApplication() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel0_ReturnsWebApplication() { // Arrange @@ -49,7 +49,7 @@ public void CreateWebApplication_WithLevel0_ReturnsWebApplication() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel1_ReturnsWebApplication() { // Arrange @@ -63,7 +63,7 @@ public void CreateWebApplication_WithLevel1_ReturnsWebApplication() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel2_ReturnsWebApplication() { // Arrange @@ -77,7 +77,7 @@ public void CreateWebApplication_WithLevel2_ReturnsWebApplication() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel3_ReturnsWebApplication() { // Arrange @@ -91,7 +91,7 @@ public void CreateWebApplication_WithLevel3_ReturnsWebApplication() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithPortEnvironmentVariable_UsesRailwayMode() { // Arrange @@ -105,7 +105,7 @@ public void CreateWebApplication_WithPortEnvironmentVariable_UsesRailwayMode() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithPortAndMaturityLevel_ConfiguresBothCorrectly() { // Arrange @@ -119,7 +119,7 @@ public void CreateWebApplication_WithPortAndMaturityLevel_ConfiguresBothCorrectl Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithInvalidMaturityLevel_FallsBackToBasicConfig() { // Arrange @@ -133,7 +133,7 @@ public void CreateWebApplication_WithInvalidMaturityLevel_FallsBackToBasicConfig Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithNoMaturityLevel_RegistersAllLevelServices() { // Arrange @@ -151,7 +151,7 @@ public void CreateWebApplication_WithNoMaturityLevel_RegistersAllLevelServices() Assert.NotNull(app.Services.GetService()); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel0_RegistersHealthCheckService() { // Arrange @@ -167,7 +167,7 @@ public void CreateWebApplication_WithLevel0_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithNoMaturityLevel_RegistersHealthCheckService() { // Arrange @@ -183,7 +183,7 @@ public void CreateWebApplication_WithNoMaturityLevel_RegistersHealthCheckService Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithEmptyArgs_ReturnsWebApplication() { // Arrange @@ -197,7 +197,7 @@ public void CreateWebApplication_WithEmptyArgs_ReturnsWebApplication() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel1_RegistersLevel1Service() { // Arrange @@ -213,7 +213,7 @@ public void CreateWebApplication_WithLevel1_RegistersLevel1Service() Assert.NotNull(level1Service); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel2_RegistersLevel2Service() { // Arrange @@ -229,7 +229,7 @@ public void CreateWebApplication_WithLevel2_RegistersLevel2Service() Assert.NotNull(level2Service); } - [Fact] + [AllureXunit] public void CreateWebApplication_WithLevel3_RegistersLevel3Service() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs index 289382d..b0ef9e2 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs @@ -8,7 +8,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class ServiceConfigurationExtensionsTests { - [Fact] + [AllureXunit] public void ConfigureServices_WithLevel0_RegistersHealthCheckService() { // Arrange @@ -23,7 +23,7 @@ public void ConfigureServices_WithLevel0_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void ConfigureServices_WithLevel1_RegistersHealthCheckService() { // Arrange @@ -38,7 +38,7 @@ public void ConfigureServices_WithLevel1_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void ConfigureServices_WithLevel2_RegistersHealthCheckService() { // Arrange @@ -53,7 +53,7 @@ public void ConfigureServices_WithLevel2_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void ConfigureServices_WithLevel3_RegistersHealthCheckService() { // Arrange @@ -68,7 +68,7 @@ public void ConfigureServices_WithLevel3_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void ConfigureServices_WithLevel0_AddsControllers() { // Arrange @@ -81,7 +81,7 @@ public void ConfigureServices_WithLevel0_AddsControllers() Assert.Contains(services, s => s.ServiceType.Name == "ApplicationPartManager"); } - [Fact] + [AllureXunit] public void ConfigureServices_WithNull_RegistersHealthCheckService() { // Arrange @@ -96,7 +96,7 @@ public void ConfigureServices_WithNull_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [Fact] + [AllureXunit] public void ConfigureServices_RegistersAllLevelServices() { // Arrange @@ -120,7 +120,7 @@ public void ConfigureServices_RegistersAllLevelServices() Assert.NotNull(level3Service); } - [Fact] + [AllureXunit] public void ConfigurePipeline_WithLevel0_ConfiguresPipelineWithoutException() { // Arrange @@ -134,7 +134,7 @@ public void ConfigurePipeline_WithLevel0_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void ConfigurePipeline_WithLevel1_ConfiguresPipelineWithoutException() { // Arrange @@ -148,7 +148,7 @@ public void ConfigurePipeline_WithLevel1_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void ConfigurePipeline_WithLevel2_ConfiguresPipelineWithoutException() { // Arrange @@ -162,7 +162,7 @@ public void ConfigurePipeline_WithLevel2_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void ConfigurePipeline_WithLevel3_ConfiguresPipelineWithoutException() { // Arrange @@ -176,7 +176,7 @@ public void ConfigurePipeline_WithLevel3_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void ConfigurePipeline_WithNull_ConfiguresPipelineWithoutException() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs index ecfd292..dc1aaae 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs @@ -10,7 +10,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class SwaggerConfigurationExtensionsTests { - [Fact] + [AllureXunit] public void AddSwaggerServices_Level0_AddsSwaggerGen() { // Arrange @@ -25,7 +25,7 @@ public void AddSwaggerServices_Level0_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level1_AddsSwaggerGen() { // Arrange @@ -40,7 +40,7 @@ public void AddSwaggerServices_Level1_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level2_AddsSwaggerGen() { // Arrange @@ -55,7 +55,7 @@ public void AddSwaggerServices_Level2_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level3_AddsSwaggerGen() { // Arrange @@ -70,7 +70,7 @@ public void AddSwaggerServices_Level3_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level0_ConfiguresAllApiVersions() { // Arrange @@ -93,7 +93,7 @@ public void AddSwaggerServices_Level0_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level1_ConfiguresAllApiVersions() { // Arrange @@ -116,7 +116,7 @@ public void AddSwaggerServices_Level1_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level2_ConfiguresAllApiVersions() { // Arrange @@ -139,7 +139,7 @@ public void AddSwaggerServices_Level2_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level3_ConfiguresAllApiVersions() { // Arrange @@ -162,7 +162,7 @@ public void AddSwaggerServices_Level3_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level0_ConfiguresV0DocInfo() { // Arrange @@ -185,7 +185,7 @@ public void AddSwaggerServices_Level0_ConfiguresV0DocInfo() Assert.Equal("Richardson Maturity Model Level 0 implementation", v0Doc.Description); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level1_ConfiguresV1DocInfo() { // Arrange @@ -208,7 +208,7 @@ public void AddSwaggerServices_Level1_ConfiguresV1DocInfo() Assert.Contains("Level 1", v1Doc.Description); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level2_ConfiguresV2DocInfo() { // Arrange @@ -231,7 +231,7 @@ public void AddSwaggerServices_Level2_ConfiguresV2DocInfo() Assert.Contains("Level 2", v2Doc.Description); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level3_ConfiguresV3DocInfo() { // Arrange @@ -254,7 +254,7 @@ public void AddSwaggerServices_Level3_ConfiguresV3DocInfo() Assert.Contains("HATEOAS", v3Doc.Description); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level0_ConfiguresDocInclusionPredicate() { // Arrange @@ -275,7 +275,7 @@ public void AddSwaggerServices_Level0_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level1_ConfiguresDocInclusionPredicate() { // Arrange @@ -295,7 +295,7 @@ public void AddSwaggerServices_Level1_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level2_ConfiguresDocInclusionPredicate() { // Arrange @@ -315,7 +315,7 @@ public void AddSwaggerServices_Level2_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level3_ConfiguresDocInclusionPredicate() { // Arrange @@ -335,7 +335,7 @@ public void AddSwaggerServices_Level3_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [Fact] + [AllureXunit] public void UseSwaggerMiddleware_Level0_ConfiguresSwagger() { // Arrange @@ -355,7 +355,7 @@ public void UseSwaggerMiddleware_Level0_ConfiguresSwagger() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void UseSwaggerMiddleware_Level1_ConfiguresSwagger() { // Arrange @@ -371,7 +371,7 @@ public void UseSwaggerMiddleware_Level1_ConfiguresSwagger() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void UseSwaggerMiddleware_Level2_ConfiguresSwagger() { // Arrange @@ -387,7 +387,7 @@ public void UseSwaggerMiddleware_Level2_ConfiguresSwagger() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void UseSwaggerMiddleware_Level3_ConfiguresSwagger() { // Arrange @@ -403,7 +403,7 @@ public void UseSwaggerMiddleware_Level3_ConfiguresSwagger() Assert.NotNull(app); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level0_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange @@ -418,7 +418,7 @@ public void AddSwaggerServices_Level0_RegistersMultipleSwaggerGenOptionsConfigur Assert.NotEmpty(swaggerGenServices); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level1_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange @@ -433,7 +433,7 @@ public void AddSwaggerServices_Level1_RegistersMultipleSwaggerGenOptionsConfigur Assert.NotEmpty(swaggerGenServices); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level2_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange @@ -448,7 +448,7 @@ public void AddSwaggerServices_Level2_RegistersMultipleSwaggerGenOptionsConfigur Assert.NotEmpty(swaggerGenServices); } - [Fact] + [AllureXunit] public void AddSwaggerServices_Level3_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs index 775f007..3bc5117 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -77,7 +77,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Arrange @@ -109,7 +109,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Arrange @@ -135,7 +135,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse() { // Arrange @@ -154,7 +154,7 @@ public async Task GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -173,7 +173,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Arrange @@ -216,7 +216,7 @@ public async Task GetEpisode_WithNullParameters_ReturnsErrorResponse(int? season Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -235,7 +235,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Arrange @@ -254,7 +254,7 @@ public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task UnknownAction_ReturnsErrorResponse() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs index b2bb561..ddf1aa6 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class ApiRequestTests { - [Fact] + [AllureXunit] public void ApiRequest_DefaultValues_AreCorrect() { // Act @@ -16,7 +16,7 @@ public void ApiRequest_DefaultValues_AreCorrect() Assert.Null(request.Episode); } - [Fact] + [AllureXunit] public void ApiRequest_PropertiesCanBeSet() { // Arrange @@ -52,7 +52,7 @@ public void ApiRequest_ActionProperty_AcceptsVariousValues(string action) Assert.Equal(action, request.Action); } - [Fact] + [AllureXunit] public void ApiRequest_ActionProperty_AcceptsNullValue() { // Act @@ -76,7 +76,7 @@ public void ApiRequest_SeasonProperty_AcceptsNullableIntValues(int? season) Assert.Equal(season, request.Season); } - [Fact] + [AllureXunit] public void ApiRequest_SeasonProperty_AcceptsNullValue() { // Act @@ -100,7 +100,7 @@ public void ApiRequest_EpisodeProperty_AcceptsNullableIntValues(int? episode) Assert.Equal(episode, request.Episode); } - [Fact] + [AllureXunit] public void ApiRequest_EpisodeProperty_AcceptsNullValue() { // Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs index b42f67c..19c622b 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class ApiResponseTests { - [Fact] + [AllureXunit] public void ApiResponse_DefaultValues_AreCorrect() { // Act @@ -17,7 +17,7 @@ public void ApiResponse_DefaultValues_AreCorrect() Assert.Null(response.Error); } - [Fact] + [AllureXunit] public void ApiResponse_SuccessResponse_PropertiesSetCorrectly() { // Arrange @@ -39,7 +39,7 @@ public void ApiResponse_SuccessResponse_PropertiesSetCorrectly() Assert.Null(response.Error); } - [Fact] + [AllureXunit] public void ApiResponse_ErrorResponse_PropertiesSetCorrectly() { // Arrange @@ -61,7 +61,7 @@ public void ApiResponse_ErrorResponse_PropertiesSetCorrectly() Assert.Equal(error, response.Error); } - [Fact] + [AllureXunit] public void ApiResponse_GenericType_WorksWithDifferentTypes() { // Arrange & Act @@ -101,7 +101,7 @@ public void ApiResponse_MessageProperty_AcceptsStringValues(string message) Assert.Equal(message, response.Message); } - [Fact] + [AllureXunit] public void ApiResponse_MessageProperty_AcceptsNullValue() { // Act @@ -124,7 +124,7 @@ public void ApiResponse_ErrorProperty_AcceptsStringValues(string error) Assert.Equal(error, response.Error); } - [Fact] + [AllureXunit] public void ApiResponse_ErrorProperty_AcceptsNullValue() { // Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs index f3136ef..dfa58e7 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class EpisodeTests { - [Fact] + [AllureXunit] public void Episode_DefaultValues_AreCorrect() { // Act @@ -17,7 +17,7 @@ public void Episode_DefaultValues_AreCorrect() Assert.Equal(string.Empty, episode.ReleasedDate); } - [Fact] + [AllureXunit] public void Episode_PropertiesCanBeSet() { // Arrange @@ -55,7 +55,7 @@ public void Episode_SeasonProperty_AcceptsNullableIntValues(int? season) Assert.Equal(season, episode.Season); } - [Fact] + [AllureXunit] public void Episode_SeasonProperty_AcceptsNullValue() { // Act @@ -78,7 +78,7 @@ public void Episode_EpisodeNumberProperty_AcceptsNullableIntValues(int? episodeN Assert.Equal(episodeNumber, episode.EpisodeNumber); } - [Fact] + [AllureXunit] public void Episode_EpisodeNumberProperty_AcceptsNullValue() { // Act @@ -101,7 +101,7 @@ public void Episode_TitleProperty_AcceptsStringValues(string title) Assert.Equal(title, episode.Title); } - [Fact] + [AllureXunit] public void Episode_TitleProperty_AcceptsNullValue() { // Act @@ -124,7 +124,7 @@ public void Episode_ReleasedDateProperty_AcceptsStringValues(string releasedDate Assert.Equal(releasedDate, episode.ReleasedDate); } - [Fact] + [AllureXunit] public void Episode_ReleasedDateProperty_AcceptsNullValue() { // Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs index aa79470..41ba718 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [Fact] + [AllureXunit] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs index 6d3bb8f..85353f8 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs @@ -16,7 +16,7 @@ public Level0ControllerTests() _controller = new Level0Controller(_service); } - [Fact] + [AllureXunit] public void HandleRequest_GetAllSeasons_ReturnsSuccessResponse() { // Arrange @@ -36,7 +36,7 @@ public void HandleRequest_GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Arrange @@ -55,7 +55,7 @@ public void HandleRequest_GetSeasonEpisodes_WithValidSeason_ReturnsSuccessRespon Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse() { // Arrange @@ -74,7 +74,7 @@ public void HandleRequest_GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse( Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -93,7 +93,7 @@ public void HandleRequest_GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorRespon Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Arrange @@ -134,7 +134,7 @@ public void HandleRequest_GetEpisode_WithNullParameters_ReturnsErrorResponse(int Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -153,7 +153,7 @@ public void HandleRequest_GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Arrange @@ -172,7 +172,7 @@ public void HandleRequest_GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_UnknownAction_ReturnsErrorResponse() { // Arrange @@ -191,7 +191,7 @@ public void HandleRequest_UnknownAction_ReturnsErrorResponse() Assert.Equal("Invalid action", response.Message); } - [Fact] + [AllureXunit] public void HandleRequest_CaseInsensitiveActions_WorksCorrectly() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs index eb5c001..93a40d6 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class SeasonTests { - [Fact] + [AllureXunit] public void Season_DefaultValues_AreCorrect() { // Act @@ -15,7 +15,7 @@ public void Season_DefaultValues_AreCorrect() Assert.Equal(0, season.EpisodeCount); } - [Fact] + [AllureXunit] public void Season_PropertiesCanBeSet() { // Arrange @@ -48,7 +48,7 @@ public void Season_SeasonNumberProperty_AcceptsStringValues(string seasonNumber) Assert.Equal(seasonNumber, season.SeasonNumber); } - [Fact] + [AllureXunit] public void Season_SeasonNumberProperty_AcceptsNullValue() { // Act @@ -73,7 +73,7 @@ public void Season_EpisodeCountProperty_AcceptsIntValues(int episodeCount) Assert.Equal(episodeCount, season.EpisodeCount); } - [Fact] + [AllureXunit] public void Season_WithValidData_RepresentsSeasonCorrectly() { // Arrange & Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs index 97a0e8c..a1b4f6d 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs @@ -11,7 +11,7 @@ public TheOfficeServiceTests() _service = new TheOfficeService(); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsNonEmptyList() { // Act @@ -22,7 +22,7 @@ public void GetAllSeasons_ReturnsNonEmptyList() Assert.NotEmpty(seasons); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsOrderedSeasons() { // Act @@ -37,7 +37,7 @@ public void GetAllSeasons_ReturnsOrderedSeasons() } } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithValidSeason_ReturnsEpisodes() { // Arrange @@ -51,7 +51,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsEpisodes() Assert.All(episodes, episode => Assert.Equal(season, episode.Season)); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithNullSeason_ReturnsEmptyList() { // Act @@ -62,7 +62,7 @@ public void GetSeasonEpisodes_WithNullSeason_ReturnsEmptyList() Assert.Empty(episodes); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithInvalidSeason_ReturnsEmptyList() { // Arrange @@ -76,7 +76,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_ReturnsEmptyList() Assert.Empty(episodes); } - [Fact] + [AllureXunit] public void GetEpisode_WithValidSeasonAndEpisode_ReturnsEpisode() { // Arrange @@ -105,7 +105,7 @@ public void GetEpisode_WithNullParameters_ReturnsNull(int? season, int? episode) Assert.Null(result); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidSeasonAndEpisode_ReturnsNull() { // Arrange diff --git a/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs index d56354c..be553e3 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -69,7 +69,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -92,7 +92,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -117,7 +117,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -135,7 +135,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -155,7 +155,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -173,7 +173,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Act @@ -191,7 +191,7 @@ public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_AlwaysReturnsHttpOk() { // Act @@ -201,7 +201,7 @@ public async Task GetAllSeasons_AlwaysReturnsHttpOk() Assert.Equal(HttpStatusCode.OK, response.StatusCode); } - [Fact] + [AllureXunit] public async Task ResourceBasedEndpoints_UsesDifferentUris() { // This test demonstrates the key difference of Level 1: resource-based URIs diff --git a/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs b/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs index def7700..a4f913b 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs @@ -16,7 +16,7 @@ public EpisodesControllerTests() _controller = new EpisodesController(_service); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -32,7 +32,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -48,7 +48,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithSeasonZero_ReturnsErrorResponse() { // Act @@ -63,7 +63,7 @@ public void GetSeasonEpisodes_WithSeasonZero_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [Fact] + [AllureXunit] public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -79,7 +79,7 @@ public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -95,7 +95,7 @@ public void GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Act @@ -111,7 +111,7 @@ public void GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() { // Act @@ -124,7 +124,7 @@ public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() Assert.Equal(1, response.Data.EpisodeNumber); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_ReturnsCorrectNumberOfEpisodes() { // Act diff --git a/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs index 5da8a27..0afdfeb 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [Fact] + [AllureXunit] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs b/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs index 1d65be2..db0430b 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs @@ -16,7 +16,7 @@ public SeasonsControllerTests() _controller = new SeasonsController(_service); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsAllSeasons() { // Act @@ -45,7 +45,7 @@ public void GetAllSeasons_ReturnsAllSeasons() Assert.Equal(9, response.Data.Count); // The Office has 9 seasons } - [Fact] + [AllureXunit] public void GetAllSeasons_AlwaysReturnsOkStatus() { // Act diff --git a/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs index 2759f93..5ebc96f 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -70,7 +70,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -93,7 +93,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -112,7 +112,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -130,7 +130,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -155,7 +155,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -173,7 +173,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -193,7 +193,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -211,7 +211,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -229,7 +229,7 @@ public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task Level2_UsesProperHttpVerbs() { // This test demonstrates the key difference of Level 2: proper HTTP verbs @@ -244,7 +244,7 @@ public async Task Level2_UsesProperHttpVerbs() Assert.Equal(HttpStatusCode.OK, episodesResponse.StatusCode); } - [Fact] + [AllureXunit] public async Task Level2_UsesProperHttpStatusCodes() { // This test demonstrates Level 2's use of proper HTTP status codes @@ -261,7 +261,7 @@ public async Task Level2_UsesProperHttpStatusCodes() Assert.Equal(HttpStatusCode.NotFound, invalidResponse.StatusCode); } - [Fact] + [AllureXunit] public async Task ResourceBasedEndpoints_UsesDifferentUris() { // This test demonstrates that Level 2 maintains resource-based URIs from Level 1 diff --git a/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs b/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs index fb7e900..d5dcab4 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs @@ -16,7 +16,7 @@ public EpisodesControllerTests() _controller = new EpisodesController(_service); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -32,7 +32,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -48,7 +48,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithSeasonZero_Returns404NotFound() { // Act @@ -63,7 +63,7 @@ public void GetSeasonEpisodes_WithSeasonZero_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [Fact] + [AllureXunit] public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -79,7 +79,7 @@ public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -95,7 +95,7 @@ public void GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -111,7 +111,7 @@ public void GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() { // Act @@ -124,7 +124,7 @@ public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() Assert.Equal(1, response.Data.EpisodeNumber); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_ReturnsCorrectNumberOfEpisodes() { // Act @@ -136,7 +136,7 @@ public void GetSeasonEpisodes_ReturnsCorrectNumberOfEpisodes() Assert.Equal(6, response.Data.Count); // Season 1 has 6 episodes } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_ForSeasonTwo_ReturnsCorrectNumberOfEpisodes() { // Act @@ -148,7 +148,7 @@ public void GetSeasonEpisodes_ForSeasonTwo_ReturnsCorrectNumberOfEpisodes() Assert.Equal(22, response.Data.Count); // Season 2 has 22 episodes } - [Fact] + [AllureXunit] public void GetEpisode_ReturnsProperHttpStatusCodes() { // Act - Valid request diff --git a/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs index be03637..695c27e 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [Fact] + [AllureXunit] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs b/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs index 9be3a6b..234d237 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs @@ -16,7 +16,7 @@ public SeasonsControllerTests() _controller = new SeasonsController(_service); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsAllSeasons() { // Act @@ -45,7 +45,7 @@ public void GetAllSeasons_ReturnsAllSeasons() Assert.Equal(9, response.Data.Count); // The Office has 9 seasons } - [Fact] + [AllureXunit] public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -62,7 +62,7 @@ public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -78,7 +78,7 @@ public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetSeason_WithSeasonZero_Returns404NotFound() { // Act @@ -93,7 +93,7 @@ public void GetSeason_WithSeasonZero_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [Fact] + [AllureXunit] public void GetSeason_WithSeasonTwo_ReturnsCorrectSeason() { // Act @@ -106,7 +106,7 @@ public void GetSeason_WithSeasonTwo_ReturnsCorrectSeason() Assert.Equal(22, response.Data.EpisodeCount); // Season 2 has 22 episodes } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsOkStatus() { // Act diff --git a/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs index 690341a..0ee589b 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -70,7 +70,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -93,7 +93,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_IncludesHypermediaLinks() { // Act @@ -128,7 +128,7 @@ public async Task GetAllSeasons_IncludesHypermediaLinks() }); } - [Fact] + [AllureXunit] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -147,7 +147,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeason_IncludesNavigationLinks() { // Act @@ -178,7 +178,7 @@ public async Task GetSeason_IncludesNavigationLinks() Assert.Equal("/api/v3/seasons", collectionLink.Href); } - [Fact] + [AllureXunit] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -201,7 +201,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.NotNull(collectionLink); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -226,7 +226,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_IncludesHypermediaLinks() { // Act @@ -261,7 +261,7 @@ public async Task GetSeasonEpisodes_IncludesHypermediaLinks() }); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -279,7 +279,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -299,7 +299,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_IncludesNextAndPreviousLinks() { // Act - Get middle episode @@ -334,7 +334,7 @@ public async Task GetEpisode_IncludesNextAndPreviousLinks() Assert.NotNull(collectionLink); } - [Fact] + [AllureXunit] public async Task GetFirstEpisode_HasNoPreviousLink() { // Act - Get first episode @@ -357,7 +357,7 @@ public async Task GetFirstEpisode_HasNoPreviousLink() Assert.NotNull(nextLink); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -375,7 +375,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -397,7 +397,7 @@ public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.NotEmpty(apiResponse.Links); } - [Fact] + [AllureXunit] public async Task Level3_UsesProperHttpVerbs() { // This test demonstrates that Level 3 maintains proper HTTP verbs from Level 2 @@ -412,7 +412,7 @@ public async Task Level3_UsesProperHttpVerbs() Assert.Equal(HttpStatusCode.OK, episodesResponse.StatusCode); } - [Fact] + [AllureXunit] public async Task Level3_UsesProperHttpStatusCodes() { // This test demonstrates Level 3 maintains proper HTTP status codes from Level 2 @@ -429,7 +429,7 @@ public async Task Level3_UsesProperHttpStatusCodes() Assert.Equal(HttpStatusCode.NotFound, invalidResponse.StatusCode); } - [Fact] + [AllureXunit] public async Task Level3_HATEOAS_LinksEnableDiscoverability() { // This test demonstrates the key feature of Level 3: hypermedia links enable API discoverability @@ -461,7 +461,7 @@ public async Task Level3_HATEOAS_LinksEnableDiscoverability() Assert.Equal(HttpStatusCode.OK, episodeResponse.StatusCode); } - [Fact] + [AllureXunit] public async Task ResourceBasedEndpoints_UsesDifferentUris() { // This test demonstrates that Level 3 maintains resource-based URIs from Levels 1 and 2 diff --git a/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs b/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs index 8ed4b7b..602082d 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs @@ -16,7 +16,7 @@ public EpisodesControllerTests() _controller = new EpisodesController(_service); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_IncludesHypermediaLinks() { // Act @@ -63,7 +63,7 @@ public void GetSeasonEpisodes_IncludesHypermediaLinks() }); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -79,7 +79,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -97,7 +97,7 @@ public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_IncludesNextAndPreviousLinks() { // Act - Get middle episode @@ -130,7 +130,7 @@ public void GetEpisode_IncludesNextAndPreviousLinks() Assert.NotNull(collectionLink); } - [Fact] + [AllureXunit] public void GetFirstEpisode_HasNoPreviousLink() { // Act - Get first episode @@ -151,7 +151,7 @@ public void GetFirstEpisode_HasNoPreviousLink() Assert.NotNull(nextLink); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -167,7 +167,7 @@ public void GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -183,7 +183,7 @@ public void GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [Fact] + [AllureXunit] public void GetSeasonEpisodes_ReturnsAllEpisodesForSeason() { // Act @@ -199,7 +199,7 @@ public void GetSeasonEpisodes_ReturnsAllEpisodesForSeason() }); } - [Fact] + [AllureXunit] public void GetEpisode_ReturnsCorrectEpisodeDetails() { // Act diff --git a/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs index 92e2772..5a29b0c 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [Fact] + [AllureXunit] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [Fact] + [AllureXunit] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [Fact] + [AllureXunit] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs b/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs index a87abcf..0304673 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs @@ -16,7 +16,7 @@ public SeasonsControllerTests() _controller = new SeasonsController(_service); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetAllSeasons_ReturnsAllSeasons() { // Act @@ -45,7 +45,7 @@ public void GetAllSeasons_ReturnsAllSeasons() Assert.Equal(9, response.Data.Count); // The Office has 9 seasons } - [Fact] + [AllureXunit] public void GetAllSeasons_IncludesHypermediaLinks() { // Act @@ -77,7 +77,7 @@ public void GetAllSeasons_IncludesHypermediaLinks() }); } - [Fact] + [AllureXunit] public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -94,7 +94,7 @@ public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", response.Message); } - [Fact] + [AllureXunit] public void GetSeason_IncludesNavigationLinks() { // Act @@ -123,7 +123,7 @@ public void GetSeason_IncludesNavigationLinks() Assert.Equal("/api/v3/seasons", collectionLink.Href); } - [Fact] + [AllureXunit] public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -144,7 +144,7 @@ public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.NotNull(collectionLink); } - [Fact] + [AllureXunit] public void GetSeason_WithSeasonZero_Returns404NotFound() { // Act @@ -159,7 +159,7 @@ public void GetSeason_WithSeasonZero_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [Fact] + [AllureXunit] public void GetSeason_WithSeasonTwo_ReturnsCorrectSeason() { // Act diff --git a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs index 9b0212f..5f05384 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs @@ -37,7 +37,7 @@ private async Task SendApiRequestAsync(ApiRequest request) return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Arrange @@ -58,7 +58,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Arrange @@ -79,7 +79,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -98,7 +98,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Arrange @@ -119,7 +119,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -138,7 +138,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task UnknownAction_ReturnsErrorResponse() { // Arrange diff --git a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs index d89b56c..673b6ad 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs @@ -30,7 +30,7 @@ public Level1E2ETests() return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -48,7 +48,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -67,7 +67,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -84,7 +84,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -103,7 +103,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -120,7 +120,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task Level1_UsesResourceBasedUris() { // This test verifies Level 1 characteristic: resource-based URIs diff --git a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs index 8681665..6d2bcfb 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs @@ -31,7 +31,7 @@ public Level2E2ETests() return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -49,7 +49,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -67,7 +67,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("1", apiResponse.Data.SeasonNumber); } - [Fact] + [AllureXunit] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -84,7 +84,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -103,7 +103,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -120,7 +120,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -139,7 +139,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -156,7 +156,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -173,7 +173,7 @@ public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Contains("Episode parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task Level2_UsesProperHttpVerbs() { // This test demonstrates Level 2 characteristic: proper HTTP verbs @@ -189,7 +189,7 @@ public async Task Level2_UsesProperHttpVerbs() Assert.Equal(HttpStatusCode.OK, episodesResponse.StatusCode); } - [Fact] + [AllureXunit] public async Task Level2_UsesProperHttpStatusCodes() { // This test demonstrates Level 2's use of proper HTTP status codes diff --git a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs index aeaec8d..326f8ae 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs @@ -31,7 +31,7 @@ public Level3E2ETests() return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -49,7 +49,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_IncludesHypermediaLinks() { // Act @@ -68,7 +68,7 @@ public async Task GetAllSeasons_IncludesHypermediaLinks() Assert.Contains("/api/v3/seasons", selfLink.Href); } - [Fact] + [AllureXunit] public async Task GetAllSeasons_EachSeasonIncludesHypermediaLinks() { // Act @@ -90,7 +90,7 @@ public async Task GetAllSeasons_EachSeasonIncludesHypermediaLinks() }); } - [Fact] + [AllureXunit] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -108,7 +108,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("1", apiResponse.Data.SeasonNumber); } - [Fact] + [AllureXunit] public async Task GetSeason_IncludesHypermediaLinks() { // Act @@ -133,7 +133,7 @@ public async Task GetSeason_IncludesHypermediaLinks() Assert.Contains("/api/v3/seasons/1/episodes", episodesLink.Href); } - [Fact] + [AllureXunit] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -150,7 +150,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -169,7 +169,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [Fact] + [AllureXunit] public async Task GetSeasonEpisodes_EachEpisodeIncludesHypermediaLinks() { // Act @@ -192,7 +192,7 @@ public async Task GetSeasonEpisodes_EachEpisodeIncludesHypermediaLinks() }); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -211,7 +211,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [Fact] + [AllureXunit] public async Task GetEpisode_IncludesHypermediaLinks() { // Act @@ -236,7 +236,7 @@ public async Task GetEpisode_IncludesHypermediaLinks() Assert.Contains("/api/v3/seasons/1", seasonLink.Href); } - [Fact] + [AllureXunit] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -253,7 +253,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [Fact] + [AllureXunit] public async Task Level3_LinksAreNavigable() { // This test demonstrates HATEOAS: following hypermedia links to navigate the API From e92011ba99e3640c3afa37670403571b401cd45f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 13:54:11 +0000 Subject: [PATCH 2/4] fix: add missing Allure.Xunit.Attributes using in E2E tests The E2E test files had explicit using directives that didn't include the Allure namespace, causing build failures. Added the missing using directive to all E2E test files. --- tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs | 1 + tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs | 1 + tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs | 1 + tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs index 5f05384..6f111de 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs @@ -1,6 +1,7 @@ using System.Net; using System.Text; using System.Text.Json; +using Allure.Xunit.Attributes; using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs index 673b6ad..12d6ef8 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs @@ -1,5 +1,6 @@ using System.Net; using System.Text.Json; +using Allure.Xunit.Attributes; using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs index 6d2bcfb..b3cd47e 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs @@ -1,5 +1,6 @@ using System.Net; using System.Text.Json; +using Allure.Xunit.Attributes; using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs index 326f8ae..4dab25b 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs @@ -1,5 +1,6 @@ using System.Net; using System.Text.Json; +using Allure.Xunit.Attributes; using Xunit; namespace TheOfficeAPI.Tests.E2E; From de40e21dce129365dafcaba87678042a93521e06 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 13:58:34 +0000 Subject: [PATCH 3/4] fix: add global usings to E2E test project csproj Move Xunit and Allure.Xunit.Attributes using directives to the project file level (like other test projects) to ensure proper resolution during build. This is more consistent with how other test projects are configured. --- tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs | 2 -- tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs | 2 -- tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs | 2 -- tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs | 2 -- tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj | 5 +++++ 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs index 6f111de..384e599 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs @@ -1,8 +1,6 @@ using System.Net; using System.Text; using System.Text.Json; -using Allure.Xunit.Attributes; -using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs index 12d6ef8..4c976fb 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs @@ -1,7 +1,5 @@ using System.Net; using System.Text.Json; -using Allure.Xunit.Attributes; -using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs index b3cd47e..6c3d380 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs @@ -1,7 +1,5 @@ using System.Net; using System.Text.Json; -using Allure.Xunit.Attributes; -using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs index 4dab25b..e7a8f77 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs @@ -1,7 +1,5 @@ using System.Net; using System.Text.Json; -using Allure.Xunit.Attributes; -using Xunit; namespace TheOfficeAPI.Tests.E2E; diff --git a/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj b/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj index cb3bae8..18ef90e 100644 --- a/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj +++ b/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj @@ -22,4 +22,9 @@ + + + + + From ab1a3cf01b9b7b485a24a115aec42b7fdff98670 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 14:04:08 +0000 Subject: [PATCH 4/4] fix: revert to [Fact] - AllureXunit removed in Allure.Xunit 2.12+ The AllureXunit attribute was removed in Allure.Xunit 2.12.0. In version 2.14.1, Allure automatically integrates with xUnit using the standard [Fact] and [Theory] attributes - no special attributes needed. See: https://allurereport.org/docs/xunit/ Changes: - Revert all [AllureXunit] back to [Fact] - Remove unnecessary Allure.Xunit.Attributes global usings - Keep Allure.Xunit package for automatic test result generation --- tests/Directory.Build.props | 5 -- .../ConfigurationOptionsTests.cs | 16 +++---- .../ErrorResponseTests.cs | 18 +++---- .../GlobalExceptionHandlerMiddlewareTests.cs | 24 +++++----- .../HealthCheckModelsTests.cs | 30 ++++++------ .../HealthCheckServiceTests.cs | 24 +++++----- .../LevelServiceExtensionsTests.cs | 26 +++++----- .../ProgramTests.cs | 30 ++++++------ .../ServiceConfigurationExtensionsTests.cs | 24 +++++----- .../SwaggerConfigurationExtensionsTests.cs | 48 +++++++++---------- .../TheOfficeApiIntegrationTests.cs | 16 +++---- .../ApiRequestTests.cs | 10 ++-- .../ApiResponseTests.cs | 12 ++--- .../EpisodeTests.cs | 12 ++--- .../HealthControllerTests.cs | 16 +++---- .../Level0ControllerTests.cs | 18 +++---- .../SeasonTests.cs | 8 ++-- .../TheOfficeServiceTests.cs | 14 +++--- .../TheOfficeApiIntegrationTests.cs | 16 +++---- .../EpisodesControllerTests.cs | 16 +++---- .../HealthControllerTests.cs | 16 +++---- .../SeasonsControllerTests.cs | 6 +-- .../TheOfficeApiIntegrationTests.cs | 22 ++++----- .../EpisodesControllerTests.cs | 20 ++++---- .../HealthControllerTests.cs | 16 +++---- .../SeasonsControllerTests.cs | 14 +++--- .../TheOfficeApiIntegrationTests.cs | 34 ++++++------- .../EpisodesControllerTests.cs | 20 ++++---- .../HealthControllerTests.cs | 16 +++---- .../SeasonsControllerTests.cs | 16 +++---- .../TheOfficeAPI.Tests.E2E/Level0E2ETests.cs | 12 ++--- .../TheOfficeAPI.Tests.E2E/Level1E2ETests.cs | 12 ++--- .../TheOfficeAPI.Tests.E2E/Level2E2ETests.cs | 20 ++++---- .../TheOfficeAPI.Tests.E2E/Level3E2ETests.cs | 24 +++++----- .../TheOfficeAPI.Tests.E2E.csproj | 1 - 35 files changed, 313 insertions(+), 319 deletions(-) diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 8c75439..5cd6820 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,9 +1,4 @@ - - - - - diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs index af01119..9a76e62 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ConfigurationOptionsTests.cs @@ -4,14 +4,14 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class ConfigurationOptionsTests { - [AllureXunit] + [Fact] public void EnvironmentOptions_SectionName_ReturnsEnvironment() { // Assert Assert.Equal("Environment", EnvironmentOptions.SectionName); } - [AllureXunit] + [Fact] public void EnvironmentOptions_MaturityLevelVariable_DefaultsToEmptyString() { // Arrange @@ -21,7 +21,7 @@ public void EnvironmentOptions_MaturityLevelVariable_DefaultsToEmptyString() Assert.Equal(string.Empty, options.MaturityLevelVariable); } - [AllureXunit] + [Fact] public void EnvironmentOptions_MaturityLevelVariable_CanBeSet() { // Arrange @@ -34,14 +34,14 @@ public void EnvironmentOptions_MaturityLevelVariable_CanBeSet() Assert.Equal("CUSTOM_MATURITY_LEVEL", options.MaturityLevelVariable); } - [AllureXunit] + [Fact] public void ServerOptions_SectionName_ReturnsServer() { // Assert Assert.Equal("Server", ServerOptions.SectionName); } - [AllureXunit] + [Fact] public void ServerOptions_DefaultUrl_DefaultsToEmptyString() { // Arrange @@ -51,7 +51,7 @@ public void ServerOptions_DefaultUrl_DefaultsToEmptyString() Assert.Equal(string.Empty, options.DefaultUrl); } - [AllureXunit] + [Fact] public void ServerOptions_DefaultUrl_CanBeSet() { // Arrange @@ -64,7 +64,7 @@ public void ServerOptions_DefaultUrl_CanBeSet() Assert.Equal("http://localhost:5000", options.DefaultUrl); } - [AllureXunit] + [Fact] public void EnvironmentOptions_IsInstantiable() { // Act @@ -74,7 +74,7 @@ public void EnvironmentOptions_IsInstantiable() Assert.NotNull(options); } - [AllureXunit] + [Fact] public void ServerOptions_IsInstantiable() { // Act diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs index 487536e..a07be59 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ErrorResponseTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class ErrorResponseTests { - [AllureXunit] + [Fact] public void ErrorResponse_DefaultConstructor_SetsDefaultValues() { // Act @@ -19,7 +19,7 @@ public void ErrorResponse_DefaultConstructor_SetsDefaultValues() Assert.Null(errorResponse.TraceId); } - [AllureXunit] + [Fact] public void ErrorResponse_TimestampIsSetToUtcNow() { // Arrange @@ -34,7 +34,7 @@ public void ErrorResponse_TimestampIsSetToUtcNow() Assert.True(errorResponse.Timestamp <= afterCreation); } - [AllureXunit] + [Fact] public void ErrorResponse_CanSetStatusCode() { // Arrange @@ -47,7 +47,7 @@ public void ErrorResponse_CanSetStatusCode() Assert.Equal(404, errorResponse.StatusCode); } - [AllureXunit] + [Fact] public void ErrorResponse_CanSetMessage() { // Arrange @@ -60,7 +60,7 @@ public void ErrorResponse_CanSetMessage() Assert.Equal("Not Found", errorResponse.Message); } - [AllureXunit] + [Fact] public void ErrorResponse_CanSetDetails() { // Arrange @@ -73,7 +73,7 @@ public void ErrorResponse_CanSetDetails() Assert.Equal("Resource with ID 123 was not found", errorResponse.Details); } - [AllureXunit] + [Fact] public void ErrorResponse_CanSetPath() { // Arrange @@ -86,7 +86,7 @@ public void ErrorResponse_CanSetPath() Assert.Equal("/api/v1/test", errorResponse.Path); } - [AllureXunit] + [Fact] public void ErrorResponse_CanSetTraceId() { // Arrange @@ -99,7 +99,7 @@ public void ErrorResponse_CanSetTraceId() Assert.Equal("trace-123", errorResponse.TraceId); } - [AllureXunit] + [Fact] public void ErrorResponse_CanSetTimestamp() { // Arrange @@ -113,7 +113,7 @@ public void ErrorResponse_CanSetTimestamp() Assert.Equal(customTimestamp, errorResponse.Timestamp); } - [AllureXunit] + [Fact] public void ErrorResponse_AllPropertiesCanBeSet() { // Arrange & Act diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs index 31b134b..037b25d 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/GlobalExceptionHandlerMiddlewareTests.cs @@ -23,7 +23,7 @@ public GlobalExceptionHandlerMiddlewareTests() _httpContext.Response.Body = new MemoryStream(); } - [AllureXunit] + [Fact] public async Task InvokeAsync_NoException_CallsNext() { // Arrange @@ -43,7 +43,7 @@ public async Task InvokeAsync_NoException_CallsNext() Assert.True(nextCalled); } - [AllureXunit] + [Fact] public async Task InvokeAsync_ArgumentNullException_ReturnsBadRequest() { // Arrange @@ -70,7 +70,7 @@ public async Task InvokeAsync_ArgumentNullException_ReturnsBadRequest() Assert.Equal("Invalid request parameters", errorResponse.Message); } - [AllureXunit] + [Fact] public async Task InvokeAsync_ArgumentException_ReturnsBadRequest() { // Arrange @@ -97,7 +97,7 @@ public async Task InvokeAsync_ArgumentException_ReturnsBadRequest() Assert.Equal("Invalid argument", errorResponse.Details); } - [AllureXunit] + [Fact] public async Task InvokeAsync_KeyNotFoundException_ReturnsNotFound() { // Arrange @@ -124,7 +124,7 @@ public async Task InvokeAsync_KeyNotFoundException_ReturnsNotFound() Assert.Equal("Resource not found", errorResponse.Details); } - [AllureXunit] + [Fact] public async Task InvokeAsync_UnauthorizedAccessException_ReturnsUnauthorized() { // Arrange @@ -150,7 +150,7 @@ public async Task InvokeAsync_UnauthorizedAccessException_ReturnsUnauthorized() Assert.Equal("Unauthorized access", errorResponse.Message); } - [AllureXunit] + [Fact] public async Task InvokeAsync_InvalidOperationException_ReturnsConflict() { // Arrange @@ -177,7 +177,7 @@ public async Task InvokeAsync_InvalidOperationException_ReturnsConflict() Assert.Equal("Invalid state", errorResponse.Details); } - [AllureXunit] + [Fact] public async Task InvokeAsync_NotImplementedException_ReturnsNotImplemented() { // Arrange @@ -203,7 +203,7 @@ public async Task InvokeAsync_NotImplementedException_ReturnsNotImplemented() Assert.Equal("This functionality is not yet implemented", errorResponse.Message); } - [AllureXunit] + [Fact] public async Task InvokeAsync_TimeoutException_ReturnsRequestTimeout() { // Arrange @@ -229,7 +229,7 @@ public async Task InvokeAsync_TimeoutException_ReturnsRequestTimeout() Assert.Equal("The request timed out", errorResponse.Message); } - [AllureXunit] + [Fact] public async Task InvokeAsync_GenericException_ReturnsInternalServerError() { // Arrange @@ -256,7 +256,7 @@ public async Task InvokeAsync_GenericException_ReturnsInternalServerError() Assert.Null(errorResponse.Details); // No details in production } - [AllureXunit] + [Fact] public async Task InvokeAsync_DevelopmentEnvironment_IncludesDetailedErrors() { // Arrange @@ -280,7 +280,7 @@ public async Task InvokeAsync_DevelopmentEnvironment_IncludesDetailedErrors() Assert.Contains("Detailed error", errorResponse.Details); } - [AllureXunit] + [Fact] public async Task InvokeAsync_SetsTraceIdAndPath() { // Arrange @@ -307,7 +307,7 @@ public async Task InvokeAsync_SetsTraceIdAndPath() Assert.Equal("test-trace-id", errorResponse.TraceId); } - [AllureXunit] + [Fact] public async Task InvokeAsync_LogsException() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs index 8b2371b..8738ea7 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckModelsTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class HealthCheckModelsTests { - [AllureXunit] + [Fact] public void HealthStatus_HasExpectedValues() { // Assert @@ -13,7 +13,7 @@ public void HealthStatus_HasExpectedValues() Assert.Equal(2, (int)HealthStatus.Unhealthy); } - [AllureXunit] + [Fact] public void HealthCheckResponse_DefaultConstructor_SetsDefaultValues() { // Act @@ -25,7 +25,7 @@ public void HealthCheckResponse_DefaultConstructor_SetsDefaultValues() Assert.Null(response.Message); } - [AllureXunit] + [Fact] public void HealthCheckResponse_TimestampIsSetToUtcNow() { // Arrange @@ -40,7 +40,7 @@ public void HealthCheckResponse_TimestampIsSetToUtcNow() Assert.True(response.Timestamp <= afterCreation); } - [AllureXunit] + [Fact] public void HealthCheckResponse_CanSetStatus() { // Arrange @@ -53,7 +53,7 @@ public void HealthCheckResponse_CanSetStatus() Assert.Equal("Unhealthy", response.Status); } - [AllureXunit] + [Fact] public void HealthCheckResponse_CanSetMessage() { // Arrange @@ -66,7 +66,7 @@ public void HealthCheckResponse_CanSetMessage() Assert.Equal("Test message", response.Message); } - [AllureXunit] + [Fact] public void DetailedHealthCheckResponse_DefaultConstructor_SetsDefaultValues() { // Act @@ -82,7 +82,7 @@ public void DetailedHealthCheckResponse_DefaultConstructor_SetsDefaultValues() Assert.Equal("1.0.0", response.Version); } - [AllureXunit] + [Fact] public void DetailedHealthCheckResponse_CanSetComponents() { // Arrange @@ -100,7 +100,7 @@ public void DetailedHealthCheckResponse_CanSetComponents() Assert.True(response.Components.ContainsKey("database")); } - [AllureXunit] + [Fact] public void DetailedHealthCheckResponse_CanSetUptime() { // Arrange @@ -114,7 +114,7 @@ public void DetailedHealthCheckResponse_CanSetUptime() Assert.Equal(uptime, response.Uptime); } - [AllureXunit] + [Fact] public void DetailedHealthCheckResponse_CanSetVersion() { // Arrange @@ -127,7 +127,7 @@ public void DetailedHealthCheckResponse_CanSetVersion() Assert.Equal("2.0.0", response.Version); } - [AllureXunit] + [Fact] public void ComponentHealth_DefaultConstructor_SetsDefaultValues() { // Act @@ -139,7 +139,7 @@ public void ComponentHealth_DefaultConstructor_SetsDefaultValues() Assert.Null(component.Data); } - [AllureXunit] + [Fact] public void ComponentHealth_CanSetStatus() { // Arrange @@ -152,7 +152,7 @@ public void ComponentHealth_CanSetStatus() Assert.Equal("Degraded", component.Status); } - [AllureXunit] + [Fact] public void ComponentHealth_CanSetDescription() { // Arrange @@ -165,7 +165,7 @@ public void ComponentHealth_CanSetDescription() Assert.Equal("Database connection pool is at 90%", component.Description); } - [AllureXunit] + [Fact] public void ComponentHealth_CanSetData() { // Arrange @@ -185,7 +185,7 @@ public void ComponentHealth_CanSetData() Assert.Equal(90, component.Data["connections"]); } - [AllureXunit] + [Fact] public void DetailedHealthCheckResponse_InheritsFromHealthCheckResponse() { // Arrange & Act @@ -202,7 +202,7 @@ public void DetailedHealthCheckResponse_InheritsFromHealthCheckResponse() Assert.Equal("All systems operational", baseResponse.Message); } - [AllureXunit] + [Fact] public void ComponentHealth_AllPropertiesCanBeSet() { // Arrange & Act diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs index 9e1baf0..0389f67 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/HealthCheckServiceTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class HealthCheckServiceTests { - [AllureXunit] + [Fact] public void GetLivenessStatus_ReturnsHealthyStatus() { // Arrange @@ -20,7 +20,7 @@ public void GetLivenessStatus_ReturnsHealthyStatus() Assert.True(result.Timestamp <= DateTime.UtcNow); } - [AllureXunit] + [Fact] public void GetLivenessStatus_ReturnsCurrentTimestamp() { // Arrange @@ -36,7 +36,7 @@ public void GetLivenessStatus_ReturnsCurrentTimestamp() Assert.True(result.Timestamp <= afterCall); } - [AllureXunit] + [Fact] public void GetHealthStatus_ReturnsHealthyStatus() { // Arrange @@ -52,7 +52,7 @@ public void GetHealthStatus_ReturnsHealthyStatus() Assert.True(result.Timestamp <= DateTime.UtcNow); } - [AllureXunit] + [Fact] public void GetReadinessStatus_ReturnsDetailedHealthStatus() { // Arrange @@ -68,7 +68,7 @@ public void GetReadinessStatus_ReturnsDetailedHealthStatus() Assert.True(result.Timestamp <= DateTime.UtcNow); } - [AllureXunit] + [Fact] public void GetReadinessStatus_IncludesVersion() { // Arrange @@ -82,7 +82,7 @@ public void GetReadinessStatus_IncludesVersion() Assert.NotEmpty(result.Version); } - [AllureXunit] + [Fact] public void GetReadinessStatus_IncludesUptime() { // Arrange @@ -97,7 +97,7 @@ public void GetReadinessStatus_IncludesUptime() Assert.True(result.Uptime < TimeSpan.FromMinutes(1)); // Should be recent } - [AllureXunit] + [Fact] public void GetReadinessStatus_IncludesApplicationComponent() { // Arrange @@ -118,7 +118,7 @@ public void GetReadinessStatus_IncludesApplicationComponent() Assert.True(appComponent.Data.ContainsKey("uptime")); } - [AllureXunit] + [Fact] public void GetReadinessStatus_IncludesDataServiceComponent() { // Arrange @@ -141,7 +141,7 @@ public void GetReadinessStatus_IncludesDataServiceComponent() Assert.Equal(true, dataComponent.Data["initialized"]); } - [AllureXunit] + [Fact] public void GetReadinessStatus_UptimeIncreasesOverTime() { // Arrange @@ -156,7 +156,7 @@ public void GetReadinessStatus_UptimeIncreasesOverTime() Assert.True(result2.Uptime > result1.Uptime); } - [AllureXunit] + [Fact] public void MultipleInstances_HaveIndependentStartTimes() { // Arrange & Act @@ -171,7 +171,7 @@ public void MultipleInstances_HaveIndependentStartTimes() Assert.True(result1.Uptime > result2.Uptime); } - [AllureXunit] + [Fact] public void GetHealthStatus_ReturnsCurrentTimestamp() { // Arrange @@ -187,7 +187,7 @@ public void GetHealthStatus_ReturnsCurrentTimestamp() Assert.True(result.Timestamp <= afterCall); } - [AllureXunit] + [Fact] public void GetReadinessStatus_ReturnsCurrentTimestamp() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs index 1096e46..8af25e3 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/LevelServiceExtensionsTests.cs @@ -8,7 +8,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class LevelServiceExtensionsTests { - [AllureXunit] + [Fact] public void AddLevel0Services_RegistersTheOfficeService() { // Arrange @@ -23,7 +23,7 @@ public void AddLevel0Services_RegistersTheOfficeService() Assert.NotNull(service); } - [AllureXunit] + [Fact] public void AddLevel0Services_ReturnsServiceCollection() { // Arrange @@ -36,7 +36,7 @@ public void AddLevel0Services_ReturnsServiceCollection() Assert.Same(services, result); } - [AllureXunit] + [Fact] public void AddLevel1Services_RegistersTheOfficeService() { // Arrange @@ -51,7 +51,7 @@ public void AddLevel1Services_RegistersTheOfficeService() Assert.NotNull(service); } - [AllureXunit] + [Fact] public void AddLevel1Services_ReturnsServiceCollection() { // Arrange @@ -64,7 +64,7 @@ public void AddLevel1Services_ReturnsServiceCollection() Assert.Same(services, result); } - [AllureXunit] + [Fact] public void AddLevel2Services_RegistersTheOfficeService() { // Arrange @@ -79,7 +79,7 @@ public void AddLevel2Services_RegistersTheOfficeService() Assert.NotNull(service); } - [AllureXunit] + [Fact] public void AddLevel2Services_ReturnsServiceCollection() { // Arrange @@ -92,7 +92,7 @@ public void AddLevel2Services_ReturnsServiceCollection() Assert.Same(services, result); } - [AllureXunit] + [Fact] public void AddLevel3Services_RegistersTheOfficeService() { // Arrange @@ -107,7 +107,7 @@ public void AddLevel3Services_RegistersTheOfficeService() Assert.NotNull(service); } - [AllureXunit] + [Fact] public void AddLevel3Services_ReturnsServiceCollection() { // Arrange @@ -120,7 +120,7 @@ public void AddLevel3Services_ReturnsServiceCollection() Assert.Same(services, result); } - [AllureXunit] + [Fact] public void AllLevelServices_CanBeRegisteredTogether() { // Arrange @@ -146,7 +146,7 @@ public void AllLevelServices_CanBeRegisteredTogether() Assert.NotNull(service3); } - [AllureXunit] + [Fact] public void Level0Service_IsSingleton() { // Arrange @@ -162,7 +162,7 @@ public void Level0Service_IsSingleton() Assert.Same(service1, service2); } - [AllureXunit] + [Fact] public void Level1Service_IsSingleton() { // Arrange @@ -178,7 +178,7 @@ public void Level1Service_IsSingleton() Assert.Same(service1, service2); } - [AllureXunit] + [Fact] public void Level2Service_IsSingleton() { // Arrange @@ -194,7 +194,7 @@ public void Level2Service_IsSingleton() Assert.Same(service1, service2); } - [AllureXunit] + [Fact] public void Level3Service_IsSingleton() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs index b85d8b6..2b2042a 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ProgramTests.cs @@ -21,7 +21,7 @@ private void SetEnvironmentVariable(string name, string? value) Environment.SetEnvironmentVariable(name, value); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithNoMaturityLevel_ReturnsWebApplication() { // Arrange @@ -35,7 +35,7 @@ public void CreateWebApplication_WithNoMaturityLevel_ReturnsWebApplication() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel0_ReturnsWebApplication() { // Arrange @@ -49,7 +49,7 @@ public void CreateWebApplication_WithLevel0_ReturnsWebApplication() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel1_ReturnsWebApplication() { // Arrange @@ -63,7 +63,7 @@ public void CreateWebApplication_WithLevel1_ReturnsWebApplication() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel2_ReturnsWebApplication() { // Arrange @@ -77,7 +77,7 @@ public void CreateWebApplication_WithLevel2_ReturnsWebApplication() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel3_ReturnsWebApplication() { // Arrange @@ -91,7 +91,7 @@ public void CreateWebApplication_WithLevel3_ReturnsWebApplication() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithPortEnvironmentVariable_UsesRailwayMode() { // Arrange @@ -105,7 +105,7 @@ public void CreateWebApplication_WithPortEnvironmentVariable_UsesRailwayMode() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithPortAndMaturityLevel_ConfiguresBothCorrectly() { // Arrange @@ -119,7 +119,7 @@ public void CreateWebApplication_WithPortAndMaturityLevel_ConfiguresBothCorrectl Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithInvalidMaturityLevel_FallsBackToBasicConfig() { // Arrange @@ -133,7 +133,7 @@ public void CreateWebApplication_WithInvalidMaturityLevel_FallsBackToBasicConfig Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithNoMaturityLevel_RegistersAllLevelServices() { // Arrange @@ -151,7 +151,7 @@ public void CreateWebApplication_WithNoMaturityLevel_RegistersAllLevelServices() Assert.NotNull(app.Services.GetService()); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel0_RegistersHealthCheckService() { // Arrange @@ -167,7 +167,7 @@ public void CreateWebApplication_WithLevel0_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithNoMaturityLevel_RegistersHealthCheckService() { // Arrange @@ -183,7 +183,7 @@ public void CreateWebApplication_WithNoMaturityLevel_RegistersHealthCheckService Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithEmptyArgs_ReturnsWebApplication() { // Arrange @@ -197,7 +197,7 @@ public void CreateWebApplication_WithEmptyArgs_ReturnsWebApplication() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel1_RegistersLevel1Service() { // Arrange @@ -213,7 +213,7 @@ public void CreateWebApplication_WithLevel1_RegistersLevel1Service() Assert.NotNull(level1Service); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel2_RegistersLevel2Service() { // Arrange @@ -229,7 +229,7 @@ public void CreateWebApplication_WithLevel2_RegistersLevel2Service() Assert.NotNull(level2Service); } - [AllureXunit] + [Fact] public void CreateWebApplication_WithLevel3_RegistersLevel3Service() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs index b0ef9e2..289382d 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/ServiceConfigurationExtensionsTests.cs @@ -8,7 +8,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class ServiceConfigurationExtensionsTests { - [AllureXunit] + [Fact] public void ConfigureServices_WithLevel0_RegistersHealthCheckService() { // Arrange @@ -23,7 +23,7 @@ public void ConfigureServices_WithLevel0_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void ConfigureServices_WithLevel1_RegistersHealthCheckService() { // Arrange @@ -38,7 +38,7 @@ public void ConfigureServices_WithLevel1_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void ConfigureServices_WithLevel2_RegistersHealthCheckService() { // Arrange @@ -53,7 +53,7 @@ public void ConfigureServices_WithLevel2_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void ConfigureServices_WithLevel3_RegistersHealthCheckService() { // Arrange @@ -68,7 +68,7 @@ public void ConfigureServices_WithLevel3_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void ConfigureServices_WithLevel0_AddsControllers() { // Arrange @@ -81,7 +81,7 @@ public void ConfigureServices_WithLevel0_AddsControllers() Assert.Contains(services, s => s.ServiceType.Name == "ApplicationPartManager"); } - [AllureXunit] + [Fact] public void ConfigureServices_WithNull_RegistersHealthCheckService() { // Arrange @@ -96,7 +96,7 @@ public void ConfigureServices_WithNull_RegistersHealthCheckService() Assert.NotNull(healthCheckService); } - [AllureXunit] + [Fact] public void ConfigureServices_RegistersAllLevelServices() { // Arrange @@ -120,7 +120,7 @@ public void ConfigureServices_RegistersAllLevelServices() Assert.NotNull(level3Service); } - [AllureXunit] + [Fact] public void ConfigurePipeline_WithLevel0_ConfiguresPipelineWithoutException() { // Arrange @@ -134,7 +134,7 @@ public void ConfigurePipeline_WithLevel0_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void ConfigurePipeline_WithLevel1_ConfiguresPipelineWithoutException() { // Arrange @@ -148,7 +148,7 @@ public void ConfigurePipeline_WithLevel1_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void ConfigurePipeline_WithLevel2_ConfiguresPipelineWithoutException() { // Arrange @@ -162,7 +162,7 @@ public void ConfigurePipeline_WithLevel2_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void ConfigurePipeline_WithLevel3_ConfiguresPipelineWithoutException() { // Arrange @@ -176,7 +176,7 @@ public void ConfigurePipeline_WithLevel3_ConfiguresPipelineWithoutException() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void ConfigurePipeline_WithNull_ConfiguresPipelineWithoutException() { // Arrange diff --git a/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs b/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs index dc1aaae..ecfd292 100644 --- a/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs +++ b/tests/TheOfficeAPI.Common.Tests.Unit/SwaggerConfigurationExtensionsTests.cs @@ -10,7 +10,7 @@ namespace TheOfficeAPI.Common.Tests.Unit; public class SwaggerConfigurationExtensionsTests { - [AllureXunit] + [Fact] public void AddSwaggerServices_Level0_AddsSwaggerGen() { // Arrange @@ -25,7 +25,7 @@ public void AddSwaggerServices_Level0_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level1_AddsSwaggerGen() { // Arrange @@ -40,7 +40,7 @@ public void AddSwaggerServices_Level1_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level2_AddsSwaggerGen() { // Arrange @@ -55,7 +55,7 @@ public void AddSwaggerServices_Level2_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level3_AddsSwaggerGen() { // Arrange @@ -70,7 +70,7 @@ public void AddSwaggerServices_Level3_AddsSwaggerGen() Assert.NotNull(swaggerGenOptions); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level0_ConfiguresAllApiVersions() { // Arrange @@ -93,7 +93,7 @@ public void AddSwaggerServices_Level0_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level1_ConfiguresAllApiVersions() { // Arrange @@ -116,7 +116,7 @@ public void AddSwaggerServices_Level1_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level2_ConfiguresAllApiVersions() { // Arrange @@ -139,7 +139,7 @@ public void AddSwaggerServices_Level2_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level3_ConfiguresAllApiVersions() { // Arrange @@ -162,7 +162,7 @@ public void AddSwaggerServices_Level3_ConfiguresAllApiVersions() Assert.Contains(options.SwaggerGeneratorOptions.SwaggerDocs, d => d.Key == "v3"); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level0_ConfiguresV0DocInfo() { // Arrange @@ -185,7 +185,7 @@ public void AddSwaggerServices_Level0_ConfiguresV0DocInfo() Assert.Equal("Richardson Maturity Model Level 0 implementation", v0Doc.Description); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level1_ConfiguresV1DocInfo() { // Arrange @@ -208,7 +208,7 @@ public void AddSwaggerServices_Level1_ConfiguresV1DocInfo() Assert.Contains("Level 1", v1Doc.Description); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level2_ConfiguresV2DocInfo() { // Arrange @@ -231,7 +231,7 @@ public void AddSwaggerServices_Level2_ConfiguresV2DocInfo() Assert.Contains("Level 2", v2Doc.Description); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level3_ConfiguresV3DocInfo() { // Arrange @@ -254,7 +254,7 @@ public void AddSwaggerServices_Level3_ConfiguresV3DocInfo() Assert.Contains("HATEOAS", v3Doc.Description); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level0_ConfiguresDocInclusionPredicate() { // Arrange @@ -275,7 +275,7 @@ public void AddSwaggerServices_Level0_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level1_ConfiguresDocInclusionPredicate() { // Arrange @@ -295,7 +295,7 @@ public void AddSwaggerServices_Level1_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level2_ConfiguresDocInclusionPredicate() { // Arrange @@ -315,7 +315,7 @@ public void AddSwaggerServices_Level2_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level3_ConfiguresDocInclusionPredicate() { // Arrange @@ -335,7 +335,7 @@ public void AddSwaggerServices_Level3_ConfiguresDocInclusionPredicate() Assert.NotNull(options.SwaggerGeneratorOptions.DocInclusionPredicate); } - [AllureXunit] + [Fact] public void UseSwaggerMiddleware_Level0_ConfiguresSwagger() { // Arrange @@ -355,7 +355,7 @@ public void UseSwaggerMiddleware_Level0_ConfiguresSwagger() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void UseSwaggerMiddleware_Level1_ConfiguresSwagger() { // Arrange @@ -371,7 +371,7 @@ public void UseSwaggerMiddleware_Level1_ConfiguresSwagger() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void UseSwaggerMiddleware_Level2_ConfiguresSwagger() { // Arrange @@ -387,7 +387,7 @@ public void UseSwaggerMiddleware_Level2_ConfiguresSwagger() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void UseSwaggerMiddleware_Level3_ConfiguresSwagger() { // Arrange @@ -403,7 +403,7 @@ public void UseSwaggerMiddleware_Level3_ConfiguresSwagger() Assert.NotNull(app); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level0_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange @@ -418,7 +418,7 @@ public void AddSwaggerServices_Level0_RegistersMultipleSwaggerGenOptionsConfigur Assert.NotEmpty(swaggerGenServices); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level1_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange @@ -433,7 +433,7 @@ public void AddSwaggerServices_Level1_RegistersMultipleSwaggerGenOptionsConfigur Assert.NotEmpty(swaggerGenServices); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level2_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange @@ -448,7 +448,7 @@ public void AddSwaggerServices_Level2_RegistersMultipleSwaggerGenOptionsConfigur Assert.NotEmpty(swaggerGenServices); } - [AllureXunit] + [Fact] public void AddSwaggerServices_Level3_RegistersMultipleSwaggerGenOptionsConfigurators() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs index 3bc5117..775f007 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -77,7 +77,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Arrange @@ -109,7 +109,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Arrange @@ -135,7 +135,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse() { // Arrange @@ -154,7 +154,7 @@ public async Task GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -173,7 +173,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Arrange @@ -216,7 +216,7 @@ public async Task GetEpisode_WithNullParameters_ReturnsErrorResponse(int? season Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -235,7 +235,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Arrange @@ -254,7 +254,7 @@ public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task UnknownAction_ReturnsErrorResponse() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs index ddf1aa6..b2bb561 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiRequestTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class ApiRequestTests { - [AllureXunit] + [Fact] public void ApiRequest_DefaultValues_AreCorrect() { // Act @@ -16,7 +16,7 @@ public void ApiRequest_DefaultValues_AreCorrect() Assert.Null(request.Episode); } - [AllureXunit] + [Fact] public void ApiRequest_PropertiesCanBeSet() { // Arrange @@ -52,7 +52,7 @@ public void ApiRequest_ActionProperty_AcceptsVariousValues(string action) Assert.Equal(action, request.Action); } - [AllureXunit] + [Fact] public void ApiRequest_ActionProperty_AcceptsNullValue() { // Act @@ -76,7 +76,7 @@ public void ApiRequest_SeasonProperty_AcceptsNullableIntValues(int? season) Assert.Equal(season, request.Season); } - [AllureXunit] + [Fact] public void ApiRequest_SeasonProperty_AcceptsNullValue() { // Act @@ -100,7 +100,7 @@ public void ApiRequest_EpisodeProperty_AcceptsNullableIntValues(int? episode) Assert.Equal(episode, request.Episode); } - [AllureXunit] + [Fact] public void ApiRequest_EpisodeProperty_AcceptsNullValue() { // Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs index 19c622b..b42f67c 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/ApiResponseTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class ApiResponseTests { - [AllureXunit] + [Fact] public void ApiResponse_DefaultValues_AreCorrect() { // Act @@ -17,7 +17,7 @@ public void ApiResponse_DefaultValues_AreCorrect() Assert.Null(response.Error); } - [AllureXunit] + [Fact] public void ApiResponse_SuccessResponse_PropertiesSetCorrectly() { // Arrange @@ -39,7 +39,7 @@ public void ApiResponse_SuccessResponse_PropertiesSetCorrectly() Assert.Null(response.Error); } - [AllureXunit] + [Fact] public void ApiResponse_ErrorResponse_PropertiesSetCorrectly() { // Arrange @@ -61,7 +61,7 @@ public void ApiResponse_ErrorResponse_PropertiesSetCorrectly() Assert.Equal(error, response.Error); } - [AllureXunit] + [Fact] public void ApiResponse_GenericType_WorksWithDifferentTypes() { // Arrange & Act @@ -101,7 +101,7 @@ public void ApiResponse_MessageProperty_AcceptsStringValues(string message) Assert.Equal(message, response.Message); } - [AllureXunit] + [Fact] public void ApiResponse_MessageProperty_AcceptsNullValue() { // Act @@ -124,7 +124,7 @@ public void ApiResponse_ErrorProperty_AcceptsStringValues(string error) Assert.Equal(error, response.Error); } - [AllureXunit] + [Fact] public void ApiResponse_ErrorProperty_AcceptsNullValue() { // Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs index dfa58e7..f3136ef 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/EpisodeTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class EpisodeTests { - [AllureXunit] + [Fact] public void Episode_DefaultValues_AreCorrect() { // Act @@ -17,7 +17,7 @@ public void Episode_DefaultValues_AreCorrect() Assert.Equal(string.Empty, episode.ReleasedDate); } - [AllureXunit] + [Fact] public void Episode_PropertiesCanBeSet() { // Arrange @@ -55,7 +55,7 @@ public void Episode_SeasonProperty_AcceptsNullableIntValues(int? season) Assert.Equal(season, episode.Season); } - [AllureXunit] + [Fact] public void Episode_SeasonProperty_AcceptsNullValue() { // Act @@ -78,7 +78,7 @@ public void Episode_EpisodeNumberProperty_AcceptsNullableIntValues(int? episodeN Assert.Equal(episodeNumber, episode.EpisodeNumber); } - [AllureXunit] + [Fact] public void Episode_EpisodeNumberProperty_AcceptsNullValue() { // Act @@ -101,7 +101,7 @@ public void Episode_TitleProperty_AcceptsStringValues(string title) Assert.Equal(title, episode.Title); } - [AllureXunit] + [Fact] public void Episode_TitleProperty_AcceptsNullValue() { // Act @@ -124,7 +124,7 @@ public void Episode_ReleasedDateProperty_AcceptsStringValues(string releasedDate Assert.Equal(releasedDate, episode.ReleasedDate); } - [AllureXunit] + [Fact] public void Episode_ReleasedDateProperty_AcceptsNullValue() { // Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs index 41ba718..aa79470 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [AllureXunit] + [Fact] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs index 85353f8..6d3bb8f 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/Level0ControllerTests.cs @@ -16,7 +16,7 @@ public Level0ControllerTests() _controller = new Level0Controller(_service); } - [AllureXunit] + [Fact] public void HandleRequest_GetAllSeasons_ReturnsSuccessResponse() { // Arrange @@ -36,7 +36,7 @@ public void HandleRequest_GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Arrange @@ -55,7 +55,7 @@ public void HandleRequest_GetSeasonEpisodes_WithValidSeason_ReturnsSuccessRespon Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse() { // Arrange @@ -74,7 +74,7 @@ public void HandleRequest_GetSeasonEpisodes_WithNullSeason_ReturnsErrorResponse( Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -93,7 +93,7 @@ public void HandleRequest_GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorRespon Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Arrange @@ -134,7 +134,7 @@ public void HandleRequest_GetEpisode_WithNullParameters_ReturnsErrorResponse(int Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -153,7 +153,7 @@ public void HandleRequest_GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Arrange @@ -172,7 +172,7 @@ public void HandleRequest_GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_UnknownAction_ReturnsErrorResponse() { // Arrange @@ -191,7 +191,7 @@ public void HandleRequest_UnknownAction_ReturnsErrorResponse() Assert.Equal("Invalid action", response.Message); } - [AllureXunit] + [Fact] public void HandleRequest_CaseInsensitiveActions_WorksCorrectly() { // Arrange diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs index 93a40d6..eb5c001 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/SeasonTests.cs @@ -4,7 +4,7 @@ namespace TheOfficeAPI.Level0.Tests.Unit; public class SeasonTests { - [AllureXunit] + [Fact] public void Season_DefaultValues_AreCorrect() { // Act @@ -15,7 +15,7 @@ public void Season_DefaultValues_AreCorrect() Assert.Equal(0, season.EpisodeCount); } - [AllureXunit] + [Fact] public void Season_PropertiesCanBeSet() { // Arrange @@ -48,7 +48,7 @@ public void Season_SeasonNumberProperty_AcceptsStringValues(string seasonNumber) Assert.Equal(seasonNumber, season.SeasonNumber); } - [AllureXunit] + [Fact] public void Season_SeasonNumberProperty_AcceptsNullValue() { // Act @@ -73,7 +73,7 @@ public void Season_EpisodeCountProperty_AcceptsIntValues(int episodeCount) Assert.Equal(episodeCount, season.EpisodeCount); } - [AllureXunit] + [Fact] public void Season_WithValidData_RepresentsSeasonCorrectly() { // Arrange & Act diff --git a/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs b/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs index a1b4f6d..97a0e8c 100644 --- a/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs +++ b/tests/TheOfficeAPI.Level0.Tests.Unit/TheOfficeServiceTests.cs @@ -11,7 +11,7 @@ public TheOfficeServiceTests() _service = new TheOfficeService(); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsNonEmptyList() { // Act @@ -22,7 +22,7 @@ public void GetAllSeasons_ReturnsNonEmptyList() Assert.NotEmpty(seasons); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsOrderedSeasons() { // Act @@ -37,7 +37,7 @@ public void GetAllSeasons_ReturnsOrderedSeasons() } } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithValidSeason_ReturnsEpisodes() { // Arrange @@ -51,7 +51,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsEpisodes() Assert.All(episodes, episode => Assert.Equal(season, episode.Season)); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithNullSeason_ReturnsEmptyList() { // Act @@ -62,7 +62,7 @@ public void GetSeasonEpisodes_WithNullSeason_ReturnsEmptyList() Assert.Empty(episodes); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithInvalidSeason_ReturnsEmptyList() { // Arrange @@ -76,7 +76,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_ReturnsEmptyList() Assert.Empty(episodes); } - [AllureXunit] + [Fact] public void GetEpisode_WithValidSeasonAndEpisode_ReturnsEpisode() { // Arrange @@ -105,7 +105,7 @@ public void GetEpisode_WithNullParameters_ReturnsNull(int? season, int? episode) Assert.Null(result); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidSeasonAndEpisode_ReturnsNull() { // Arrange diff --git a/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs index be553e3..d56354c 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -69,7 +69,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -92,7 +92,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -117,7 +117,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -135,7 +135,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -155,7 +155,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -173,7 +173,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Act @@ -191,7 +191,7 @@ public async Task GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_AlwaysReturnsHttpOk() { // Act @@ -201,7 +201,7 @@ public async Task GetAllSeasons_AlwaysReturnsHttpOk() Assert.Equal(HttpStatusCode.OK, response.StatusCode); } - [AllureXunit] + [Fact] public async Task ResourceBasedEndpoints_UsesDifferentUris() { // This test demonstrates the key difference of Level 1: resource-based URIs diff --git a/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs b/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs index a4f913b..def7700 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Unit/EpisodesControllerTests.cs @@ -16,7 +16,7 @@ public EpisodesControllerTests() _controller = new EpisodesController(_service); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -32,7 +32,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -48,7 +48,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithSeasonZero_ReturnsErrorResponse() { // Act @@ -63,7 +63,7 @@ public void GetSeasonEpisodes_WithSeasonZero_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [AllureXunit] + [Fact] public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -79,7 +79,7 @@ public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -95,7 +95,7 @@ public void GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() { // Act @@ -111,7 +111,7 @@ public void GetEpisode_WithInvalidEpisode_ReturnsErrorResponse() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() { // Act @@ -124,7 +124,7 @@ public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() Assert.Equal(1, response.Data.EpisodeNumber); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_ReturnsCorrectNumberOfEpisodes() { // Act diff --git a/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs index 0afdfeb..5da8a27 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [AllureXunit] + [Fact] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs b/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs index db0430b..1d65be2 100644 --- a/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs +++ b/tests/TheOfficeAPI.Level1.Tests.Unit/SeasonsControllerTests.cs @@ -16,7 +16,7 @@ public SeasonsControllerTests() _controller = new SeasonsController(_service); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsAllSeasons() { // Act @@ -45,7 +45,7 @@ public void GetAllSeasons_ReturnsAllSeasons() Assert.Equal(9, response.Data.Count); // The Office has 9 seasons } - [AllureXunit] + [Fact] public void GetAllSeasons_AlwaysReturnsOkStatus() { // Act diff --git a/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs index 5ebc96f..2759f93 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -70,7 +70,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -93,7 +93,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -112,7 +112,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -130,7 +130,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -155,7 +155,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -173,7 +173,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -193,7 +193,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -211,7 +211,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -229,7 +229,7 @@ public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task Level2_UsesProperHttpVerbs() { // This test demonstrates the key difference of Level 2: proper HTTP verbs @@ -244,7 +244,7 @@ public async Task Level2_UsesProperHttpVerbs() Assert.Equal(HttpStatusCode.OK, episodesResponse.StatusCode); } - [AllureXunit] + [Fact] public async Task Level2_UsesProperHttpStatusCodes() { // This test demonstrates Level 2's use of proper HTTP status codes @@ -261,7 +261,7 @@ public async Task Level2_UsesProperHttpStatusCodes() Assert.Equal(HttpStatusCode.NotFound, invalidResponse.StatusCode); } - [AllureXunit] + [Fact] public async Task ResourceBasedEndpoints_UsesDifferentUris() { // This test demonstrates that Level 2 maintains resource-based URIs from Level 1 diff --git a/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs b/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs index d5dcab4..fb7e900 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Unit/EpisodesControllerTests.cs @@ -16,7 +16,7 @@ public EpisodesControllerTests() _controller = new EpisodesController(_service); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -32,7 +32,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -48,7 +48,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithSeasonZero_Returns404NotFound() { // Act @@ -63,7 +63,7 @@ public void GetSeasonEpisodes_WithSeasonZero_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [AllureXunit] + [Fact] public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -79,7 +79,7 @@ public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -95,7 +95,7 @@ public void GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -111,7 +111,7 @@ public void GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() { // Act @@ -124,7 +124,7 @@ public void GetEpisode_WithValidSeasonAndEpisode_ReturnsCorrectEpisode() Assert.Equal(1, response.Data.EpisodeNumber); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_ReturnsCorrectNumberOfEpisodes() { // Act @@ -136,7 +136,7 @@ public void GetSeasonEpisodes_ReturnsCorrectNumberOfEpisodes() Assert.Equal(6, response.Data.Count); // Season 1 has 6 episodes } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_ForSeasonTwo_ReturnsCorrectNumberOfEpisodes() { // Act @@ -148,7 +148,7 @@ public void GetSeasonEpisodes_ForSeasonTwo_ReturnsCorrectNumberOfEpisodes() Assert.Equal(22, response.Data.Count); // Season 2 has 22 episodes } - [AllureXunit] + [Fact] public void GetEpisode_ReturnsProperHttpStatusCodes() { // Act - Valid request diff --git a/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs index 695c27e..be03637 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [AllureXunit] + [Fact] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs b/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs index 234d237..9be3a6b 100644 --- a/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs +++ b/tests/TheOfficeAPI.Level2.Tests.Unit/SeasonsControllerTests.cs @@ -16,7 +16,7 @@ public SeasonsControllerTests() _controller = new SeasonsController(_service); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsAllSeasons() { // Act @@ -45,7 +45,7 @@ public void GetAllSeasons_ReturnsAllSeasons() Assert.Equal(9, response.Data.Count); // The Office has 9 seasons } - [AllureXunit] + [Fact] public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -62,7 +62,7 @@ public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -78,7 +78,7 @@ public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetSeason_WithSeasonZero_Returns404NotFound() { // Act @@ -93,7 +93,7 @@ public void GetSeason_WithSeasonZero_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [AllureXunit] + [Fact] public void GetSeason_WithSeasonTwo_ReturnsCorrectSeason() { // Act @@ -106,7 +106,7 @@ public void GetSeason_WithSeasonTwo_ReturnsCorrectSeason() Assert.Equal(22, response.Data.EpisodeCount); // Season 2 has 22 episodes } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsOkStatus() { // Act diff --git a/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs b/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs index 0ee589b..690341a 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeApiIntegrationTests.cs @@ -70,7 +70,7 @@ private static bool IsValidJson(string content) (content.StartsWith("[") && content.EndsWith("]")); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -93,7 +93,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_IncludesHypermediaLinks() { // Act @@ -128,7 +128,7 @@ public async Task GetAllSeasons_IncludesHypermediaLinks() }); } - [AllureXunit] + [Fact] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -147,7 +147,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeason_IncludesNavigationLinks() { // Act @@ -178,7 +178,7 @@ public async Task GetSeason_IncludesNavigationLinks() Assert.Equal("/api/v3/seasons", collectionLink.Href); } - [AllureXunit] + [Fact] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -201,7 +201,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.NotNull(collectionLink); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -226,7 +226,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_IncludesHypermediaLinks() { // Act @@ -261,7 +261,7 @@ public async Task GetSeasonEpisodes_IncludesHypermediaLinks() }); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -279,7 +279,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -299,7 +299,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_IncludesNextAndPreviousLinks() { // Act - Get middle episode @@ -334,7 +334,7 @@ public async Task GetEpisode_IncludesNextAndPreviousLinks() Assert.NotNull(collectionLink); } - [AllureXunit] + [Fact] public async Task GetFirstEpisode_HasNoPreviousLink() { // Act - Get first episode @@ -357,7 +357,7 @@ public async Task GetFirstEpisode_HasNoPreviousLink() Assert.NotNull(nextLink); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -375,7 +375,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -397,7 +397,7 @@ public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.NotEmpty(apiResponse.Links); } - [AllureXunit] + [Fact] public async Task Level3_UsesProperHttpVerbs() { // This test demonstrates that Level 3 maintains proper HTTP verbs from Level 2 @@ -412,7 +412,7 @@ public async Task Level3_UsesProperHttpVerbs() Assert.Equal(HttpStatusCode.OK, episodesResponse.StatusCode); } - [AllureXunit] + [Fact] public async Task Level3_UsesProperHttpStatusCodes() { // This test demonstrates Level 3 maintains proper HTTP status codes from Level 2 @@ -429,7 +429,7 @@ public async Task Level3_UsesProperHttpStatusCodes() Assert.Equal(HttpStatusCode.NotFound, invalidResponse.StatusCode); } - [AllureXunit] + [Fact] public async Task Level3_HATEOAS_LinksEnableDiscoverability() { // This test demonstrates the key feature of Level 3: hypermedia links enable API discoverability @@ -461,7 +461,7 @@ public async Task Level3_HATEOAS_LinksEnableDiscoverability() Assert.Equal(HttpStatusCode.OK, episodeResponse.StatusCode); } - [AllureXunit] + [Fact] public async Task ResourceBasedEndpoints_UsesDifferentUris() { // This test demonstrates that Level 3 maintains resource-based URIs from Levels 1 and 2 diff --git a/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs b/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs index 602082d..8ed4b7b 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Unit/EpisodesControllerTests.cs @@ -16,7 +16,7 @@ public EpisodesControllerTests() _controller = new EpisodesController(_service); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_IncludesHypermediaLinks() { // Act @@ -63,7 +63,7 @@ public void GetSeasonEpisodes_IncludesHypermediaLinks() }); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -79,7 +79,7 @@ public void GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -97,7 +97,7 @@ public void GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal("Episode retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_IncludesNextAndPreviousLinks() { // Act - Get middle episode @@ -130,7 +130,7 @@ public void GetEpisode_IncludesNextAndPreviousLinks() Assert.NotNull(collectionLink); } - [AllureXunit] + [Fact] public void GetFirstEpisode_HasNoPreviousLink() { // Act - Get first episode @@ -151,7 +151,7 @@ public void GetFirstEpisode_HasNoPreviousLink() Assert.NotNull(nextLink); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -167,7 +167,7 @@ public void GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -183,7 +183,7 @@ public void GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Equal("Invalid request", response.Message); } - [AllureXunit] + [Fact] public void GetSeasonEpisodes_ReturnsAllEpisodesForSeason() { // Act @@ -199,7 +199,7 @@ public void GetSeasonEpisodes_ReturnsAllEpisodesForSeason() }); } - [AllureXunit] + [Fact] public void GetEpisode_ReturnsCorrectEpisodeDetails() { // Act diff --git a/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs b/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs index 5a29b0c..92e2772 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Unit/HealthControllerTests.cs @@ -16,7 +16,7 @@ public HealthControllerTests() _controller = new HealthController(_healthCheckService); } - [AllureXunit] + [Fact] public void Get_ReturnsOkResult() { // Act @@ -27,7 +27,7 @@ public void Get_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void Get_ReturnsHealthCheckResponse() { // Act @@ -40,7 +40,7 @@ public void Get_ReturnsHealthCheckResponse() Assert.Equal("OK", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsOkResult() { // Act @@ -51,7 +51,7 @@ public void GetLiveness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetLiveness_ReturnsLivenessStatus() { // Act @@ -64,7 +64,7 @@ public void GetLiveness_ReturnsLivenessStatus() Assert.Equal("Application is alive", healthResponse.Message); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsOkResult() { // Act @@ -75,7 +75,7 @@ public void GetReadiness_ReturnsOkResult() Assert.NotNull(okResult.Value); } - [AllureXunit] + [Fact] public void GetReadiness_ReturnsDetailedHealthCheckResponse() { // Act @@ -91,7 +91,7 @@ public void GetReadiness_ReturnsDetailedHealthCheckResponse() Assert.True(healthResponse.Components.Count > 0); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesComponentDetails() { // Act @@ -112,7 +112,7 @@ public void GetReadiness_IncludesComponentDetails() Assert.NotNull(dataComponent.Description); } - [AllureXunit] + [Fact] public void GetReadiness_IncludesUptime() { // Arrange diff --git a/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs b/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs index 0304673..a87abcf 100644 --- a/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs +++ b/tests/TheOfficeAPI.Level3.Tests.Unit/SeasonsControllerTests.cs @@ -16,7 +16,7 @@ public SeasonsControllerTests() _controller = new SeasonsController(_service); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -33,7 +33,7 @@ public void GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetAllSeasons_ReturnsAllSeasons() { // Act @@ -45,7 +45,7 @@ public void GetAllSeasons_ReturnsAllSeasons() Assert.Equal(9, response.Data.Count); // The Office has 9 seasons } - [AllureXunit] + [Fact] public void GetAllSeasons_IncludesHypermediaLinks() { // Act @@ -77,7 +77,7 @@ public void GetAllSeasons_IncludesHypermediaLinks() }); } - [AllureXunit] + [Fact] public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -94,7 +94,7 @@ public void GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("Season 1 retrieved successfully", response.Message); } - [AllureXunit] + [Fact] public void GetSeason_IncludesNavigationLinks() { // Act @@ -123,7 +123,7 @@ public void GetSeason_IncludesNavigationLinks() Assert.Equal("/api/v3/seasons", collectionLink.Href); } - [AllureXunit] + [Fact] public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -144,7 +144,7 @@ public void GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.NotNull(collectionLink); } - [AllureXunit] + [Fact] public void GetSeason_WithSeasonZero_Returns404NotFound() { // Act @@ -159,7 +159,7 @@ public void GetSeason_WithSeasonZero_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", response.Error); } - [AllureXunit] + [Fact] public void GetSeason_WithSeasonTwo_ReturnsCorrectSeason() { // Act diff --git a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs index 384e599..12b95e6 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level0E2ETests.cs @@ -36,7 +36,7 @@ private async Task SendApiRequestAsync(ApiRequest request) return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Arrange @@ -57,7 +57,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Arrange @@ -78,7 +78,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -97,7 +97,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Arrange @@ -118,7 +118,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Arrange @@ -137,7 +137,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task UnknownAction_ReturnsErrorResponse() { // Arrange diff --git a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs index 4c976fb..fd7b832 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level1E2ETests.cs @@ -29,7 +29,7 @@ public Level1E2ETests() return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -47,7 +47,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -66,7 +66,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -83,7 +83,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -102,7 +102,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() { // Act @@ -119,7 +119,7 @@ public async Task GetEpisode_WithInvalidSeason_ReturnsErrorResponse() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task Level1_UsesResourceBasedUris() { // This test verifies Level 1 characteristic: resource-based URIs diff --git a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs index 6c3d380..2cf7f4f 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level2E2ETests.cs @@ -30,7 +30,7 @@ public Level2E2ETests() return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -48,7 +48,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -66,7 +66,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("1", apiResponse.Data.SeasonNumber); } - [AllureXunit] + [Fact] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -83,7 +83,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -102,7 +102,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() { // Act @@ -119,7 +119,7 @@ public async Task GetSeasonEpisodes_WithInvalidSeason_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -138,7 +138,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -155,7 +155,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() { // Act @@ -172,7 +172,7 @@ public async Task GetEpisode_WithInvalidEpisode_Returns404NotFound() Assert.Contains("Episode parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task Level2_UsesProperHttpVerbs() { // This test demonstrates Level 2 characteristic: proper HTTP verbs @@ -188,7 +188,7 @@ public async Task Level2_UsesProperHttpVerbs() Assert.Equal(HttpStatusCode.OK, episodesResponse.StatusCode); } - [AllureXunit] + [Fact] public async Task Level2_UsesProperHttpStatusCodes() { // This test demonstrates Level 2's use of proper HTTP status codes diff --git a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs index e7a8f77..3229406 100644 --- a/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs +++ b/tests/TheOfficeAPI.Tests.E2E/Level3E2ETests.cs @@ -30,7 +30,7 @@ public Level3E2ETests() return JsonSerializer.Deserialize(responseContent, _jsonOptions); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_ReturnsSuccessResponse() { // Act @@ -48,7 +48,7 @@ public async Task GetAllSeasons_ReturnsSuccessResponse() Assert.Equal("Seasons retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_IncludesHypermediaLinks() { // Act @@ -67,7 +67,7 @@ public async Task GetAllSeasons_IncludesHypermediaLinks() Assert.Contains("/api/v3/seasons", selfLink.Href); } - [AllureXunit] + [Fact] public async Task GetAllSeasons_EachSeasonIncludesHypermediaLinks() { // Act @@ -89,7 +89,7 @@ public async Task GetAllSeasons_EachSeasonIncludesHypermediaLinks() }); } - [AllureXunit] + [Fact] public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() { // Act @@ -107,7 +107,7 @@ public async Task GetSeason_WithValidSeasonNumber_ReturnsSuccessResponse() Assert.Equal("1", apiResponse.Data.SeasonNumber); } - [AllureXunit] + [Fact] public async Task GetSeason_IncludesHypermediaLinks() { // Act @@ -132,7 +132,7 @@ public async Task GetSeason_IncludesHypermediaLinks() Assert.Contains("/api/v3/seasons/1/episodes", episodesLink.Href); } - [AllureXunit] + [Fact] public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() { // Act @@ -149,7 +149,7 @@ public async Task GetSeason_WithInvalidSeasonNumber_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() { // Act @@ -168,7 +168,7 @@ public async Task GetSeasonEpisodes_WithValidSeason_ReturnsSuccessResponse() Assert.Equal("Episodes for season 1 retrieved successfully", apiResponse.Message); } - [AllureXunit] + [Fact] public async Task GetSeasonEpisodes_EachEpisodeIncludesHypermediaLinks() { // Act @@ -191,7 +191,7 @@ public async Task GetSeasonEpisodes_EachEpisodeIncludesHypermediaLinks() }); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() { // Act @@ -210,7 +210,7 @@ public async Task GetEpisode_WithValidParameters_ReturnsSuccessResponse() Assert.Equal(1, apiResponse.Data.EpisodeNumber); } - [AllureXunit] + [Fact] public async Task GetEpisode_IncludesHypermediaLinks() { // Act @@ -235,7 +235,7 @@ public async Task GetEpisode_IncludesHypermediaLinks() Assert.Contains("/api/v3/seasons/1", seasonLink.Href); } - [AllureXunit] + [Fact] public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() { // Act @@ -252,7 +252,7 @@ public async Task GetEpisode_WithInvalidSeason_Returns404NotFound() Assert.Contains("Season parameter is outside of the scope", apiResponse.Error); } - [AllureXunit] + [Fact] public async Task Level3_LinksAreNavigable() { // This test demonstrates HATEOAS: following hypermedia links to navigate the API diff --git a/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj b/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj index 18ef90e..dd5e532 100644 --- a/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj +++ b/tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj @@ -24,7 +24,6 @@ -