Build and publish Jiaowu packages and container image / Test, package and publish (push) Successful in 35m49s
21 lines
626 B
C#
21 lines
626 B
C#
using System.Reflection;
|
|
using Jiaowu.Api.Controllers;
|
|
|
|
namespace Jiaowu.Api.Tests;
|
|
|
|
public sealed class SystemControllerTests
|
|
{
|
|
[Fact]
|
|
public void GetVersion_ReturnsConfiguredApplicationVersion()
|
|
{
|
|
var response = new SystemController().GetVersion();
|
|
var configuredVersion = typeof(SystemController).Assembly
|
|
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!
|
|
.InformationalVersion
|
|
.Split('+', 2)[0];
|
|
|
|
Assert.Equal(configuredVersion, response.Version);
|
|
Assert.Matches(@"^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$", response.Version);
|
|
}
|
|
}
|