文件下载名称调优

This commit is contained in:
biss committed 2026-08-21 17:34:22 +08:00
1 parent cd5aa624db
commit 0e02d446ba
19 files changed
+116 -37

No files matched your search

@@ -0,0 +1,20 @@
using Jiaowu.Api.Infrastructure.Files;
namespace Jiaowu.Api.Tests;
public sealed class DownloadFileNameTests
{
[Fact]
public void Export_includes_safe_context_and_a_second_precision_timestamp()
{
var name = DownloadFileName.Export("课程/名单", "xlsx", " A:B ");
Assert.Matches("^课程-名单-A-B-\\d{8}-\\d{6}\\.xlsx$", name);
}
[Fact]
public void Template_has_a_stable_descriptive_name()
{
Assert.Equal("课程库-导入模板.xlsx", DownloadFileName.Template("课程库", ".xlsx"));
}
}