Add editor config and apply code cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-15 09:36:52 +02:00
parent 7d6f85db82
commit 4bf07b0972
11 changed files with 516 additions and 249 deletions

View File

@@ -1,6 +1,6 @@
using System.Net.Http.Json;
using FluentAssertions;
using FluentAssertions;
using FluentAssertions.Extensions;
using System.Net.Http.Json;
using Vegasco.Server.Api.Info;
namespace Vegasco.Server.Api.Tests.Integration.Info;
@@ -8,28 +8,28 @@ namespace Vegasco.Server.Api.Tests.Integration.Info;
[Collection(SharedTestCollection.Name)]
public class GetServerInfoTests
{
private readonly WebAppFactory _factory;
private readonly WebAppFactory _factory;
public GetServerInfoTests(WebAppFactory factory)
{
_factory = factory;
}
public GetServerInfoTests(WebAppFactory factory)
{
_factory = factory;
}
[Fact]
public async Task GetServerInfo_ShouldReturnServerInfo_WhenCalled()
{
// Arrange
// Act
using HttpResponseMessage response = await _factory.HttpClient.GetAsync("/v1/info/server");
[Fact]
public async Task GetServerInfo_ShouldReturnServerInfo_WhenCalled()
{
// Arrange
// Assert
response.IsSuccessStatusCode.Should().BeTrue();
var serverInfo = await response.Content.ReadFromJsonAsync<GetServerInfo.Response>();
serverInfo!.Environment.Should().NotBeEmpty();
serverInfo.CommitDate.Should().BeAfter(23.August(2024))
.And.NotBeAfter(DateTime.Now);
serverInfo.CommitId.Should().MatchRegex(@"[0-9a-f]{40}");
serverInfo.FullVersion.Should().MatchRegex(@"\d\.\d\.\d(-[0-9a-zA-Z]+)?(\+g?[0-9a-f]{10})?");
}
// Act
using HttpResponseMessage response = await _factory.HttpClient.GetAsync("/v1/info/server");
// Assert
response.IsSuccessStatusCode.Should().BeTrue();
var serverInfo = await response.Content.ReadFromJsonAsync<GetServerInfo.Response>();
serverInfo!.Environment.Should().NotBeEmpty();
serverInfo.CommitDate.Should().BeAfter(23.August(2024))
.And.NotBeAfter(DateTime.Now);
serverInfo.CommitId.Should().MatchRegex(@"[0-9a-f]{40}");
serverInfo.FullVersion.Should().MatchRegex(@"\d\.\d\.\d(-[0-9a-zA-Z]+)?(\+g?[0-9a-f]{10})?");
}
}