mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 19:21:10 +00:00
Updates unit test
This commit is contained in:
1 parent
1df31515fb
commit
f6808f9f6f
1 file changed
+4
-4
+4
-4
@@ -141,14 +141,14 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
|||||||
HttpResponseMessage response = await _client.PostAsJsonAsync("/api/v1/initialization", request);
|
HttpResponseMessage response = await _client.PostAsJsonAsync("/api/v1/initialization", request);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
response.StatusCode.Should().Be(HttpStatusCode.Forbidden);
|
response.StatusCode.Should().Be(HttpStatusCode.Conflict);
|
||||||
string content = await response.Content.ReadAsStringAsync();
|
string content = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
Dictionary<string, JsonElement>? problemDetails = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(content, _jsonOptions);
|
Dictionary<string, JsonElement>? problemDetails = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(content, _jsonOptions);
|
||||||
problemDetails.Should().NotBeNull();
|
problemDetails.Should().NotBeNull();
|
||||||
problemDetails!["status"].GetInt32().Should().Be(StatusCodes.Status403Forbidden);
|
problemDetails!["status"].GetInt32().Should().Be(StatusCodes.Status409Conflict);
|
||||||
problemDetails["type"].GetString().Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.4");
|
problemDetails["type"].GetString().Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.10");
|
||||||
problemDetails["title"].GetString().Should().Be("General.Unauthorized");
|
problemDetails["title"].GetString().Should().Be("General.Conflict");
|
||||||
problemDetails["detail"].GetString().Should().Be("AdminAccountAlreadyCreated");
|
problemDetails["detail"].GetString().Should().Be("AdminAccountAlreadyCreated");
|
||||||
problemDetails["instance"].GetString().Should().Be("/api/v1/initialization");
|
problemDetails["instance"].GetString().Should().Be("/api/v1/initialization");
|
||||||
problemDetails["traceId"].GetString().Should().NotBeNullOrWhiteSpace();
|
problemDetails["traceId"].GetString().Should().NotBeNullOrWhiteSpace();
|
||||||
|
|||||||
Reference in new issue
Block a user