From fb812268d7ae7e7f954d5df5a64f2315ed5d6c11 Mon Sep 17 00:00:00 2001 From: biss Date: Sun, 2 Aug 2026 18:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Jiaowu.Api.Tests/SystemControllerTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Jiaowu.Api.Tests/SystemControllerTests.cs b/tests/Jiaowu.Api.Tests/SystemControllerTests.cs index 3cea691..e36da42 100644 --- a/tests/Jiaowu.Api.Tests/SystemControllerTests.cs +++ b/tests/Jiaowu.Api.Tests/SystemControllerTests.cs @@ -1,3 +1,4 @@ +using System.Reflection; using Jiaowu.Api.Controllers; namespace Jiaowu.Api.Tests; @@ -8,7 +9,12 @@ public sealed class SystemControllerTests public void GetVersion_ReturnsConfiguredApplicationVersion() { var response = new SystemController().GetVersion(); + var configuredVersion = typeof(SystemController).Assembly + .GetCustomAttribute()! + .InformationalVersion + .Split('+', 2)[0]; - Assert.Equal("1.0.0", response.Version); + Assert.Equal(configuredVersion, response.Version); + Assert.Matches(@"^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$", response.Version); } }