feat: improve filtered exports and server pagination
This commit is contained in:
1 parent
4e37f3bb5c
commit
1ddfecbecc
26 files changed
+645
-120
No files matched your search
@@ -5,11 +5,21 @@ namespace Jiaowu.Api.Tests;
|
||||
public sealed class DownloadFileNameTests
|
||||
{
|
||||
[Fact]
|
||||
public void Export_includes_safe_context_and_a_second_precision_timestamp()
|
||||
public void Export_includes_safe_context_and_a_unique_human_readable_suffix()
|
||||
{
|
||||
var name = DownloadFileName.Export("课程/名单", "xlsx", " A:B ");
|
||||
|
||||
Assert.Matches("^课程-名单-A-B-\\d{8}-\\d{6}\\.xlsx$", name);
|
||||
Assert.Matches("^课程-名单-A-B-\\d{8}-\\d{6}-\\d{3}-[0-9A-F]{6}\\.xlsx$", name);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Export_does_not_repeat_when_created_in_the_same_clock_tick()
|
||||
{
|
||||
var names = Enumerable.Range(0, 100)
|
||||
.Select(_ => DownloadFileName.Export("学生名单", ".xlsx"))
|
||||
.ToArray();
|
||||
|
||||
Assert.Equal(names.Length, names.Distinct(StringComparer.Ordinal).Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in new issue
Block a user