Hardens test assertions and adds missing test coverage.

This commit is contained in:
BinaryAlley committed 2026-08-18 08:28:16 -07:00
1 parent 6b86fd5805
commit 1189bbaf36
489 files changed
+39982 -512

No files matched your search

@@ -104,7 +104,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/change-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -138,7 +138,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
Assert.Equal("UsernameDoesNotExist", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/change-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -167,7 +167,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
Assert.Equal("InvalidCurrentPassword", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/change-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -191,7 +191,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/change-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -97,7 +97,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
Assert.Equal("NotAuthorized", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/users", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -175,7 +175,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
Assert.Equal("TempPasswordExpired", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/login", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -203,7 +203,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
Assert.Equal("InvalidUsernameOrPassword", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/login", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -232,7 +232,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/login", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -136,7 +136,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
Assert.Equal("UsernameDoesNotExist", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/recover-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -164,7 +164,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/recover-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -193,7 +193,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/recover-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -228,7 +228,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/recover-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -280,7 +280,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/recover-password", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -117,7 +117,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
Assert.Equal("NotAuthorized", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/get-authorization", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -141,7 +141,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
Assert.Equal("OneOrMoreValidationErrorsOccurred", problemDetails["detail"].GetString());
Assert.Equal("/api/v1/auth/get-authorization", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
Dictionary<string, string[]>? errors = problemDetails["errors"].Deserialize<Dictionary<string, string[]>>(_jsonOptions);
Assert.NotNull(errors);
@@ -121,7 +121,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
Assert.Equal("NotAuthorized", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{user!.Id}/permissions", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -145,7 +145,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
Assert.Equal("UsernameDoesNotExist", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{nonExistentUserId}/permissions", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -102,7 +102,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
Assert.Equal("NotAuthorized", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{user!.Id}/role", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -126,7 +126,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
Assert.Equal("UsernameDoesNotExist", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{nonExistentUserId}/role", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -139,7 +139,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
Assert.Equal("NotAuthorized", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{request.UserId}/role-and-permissions", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -184,7 +184,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
Assert.Equal("CannotRemoveLastAdmin", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{request.UserId}/role-and-permissions", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]
@@ -213,7 +213,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
Assert.Equal("UserDoesNotExist", problemDetails["detail"].GetString());
Assert.Equal($"/api/v1/auth/users/{nonExistentUserId}/role-and-permissions", problemDetails["instance"].GetString());
Assert.NotNull(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString());
Assert.NotEmpty(problemDetails["traceId"].GetString()!);
}
[Fact]