aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-07-12 15:54:09 +0800
committercrupest <crupest@outlook.com>2020-07-12 15:54:09 +0800
commitb5ea38b6606fea50ac4bc42dc4109dcff258b44b (patch)
tree4700f8c24484a4875215d86fd4812527f98f8efb /Timeline.Tests
parent15e7467e6089537f0f3e2290f14a99b8a1fc2d76 (diff)
downloadtimeline-b5ea38b6606fea50ac4bc42dc4109dcff258b44b.tar.gz
timeline-b5ea38b6606fea50ac4bc42dc4109dcff258b44b.tar.bz2
timeline-b5ea38b6606fea50ac4bc42dc4109dcff258b44b.zip
Add api in service.
Diffstat (limited to 'Timeline.Tests')
-rw-r--r--Timeline.Tests/Services/TimelineServiceTest.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Timeline.Tests/Services/TimelineServiceTest.cs b/Timeline.Tests/Services/TimelineServiceTest.cs
index 123c2b7f..919400a3 100644
--- a/Timeline.Tests/Services/TimelineServiceTest.cs
+++ b/Timeline.Tests/Services/TimelineServiceTest.cs
@@ -59,6 +59,36 @@ namespace Timeline.Tests.Services
[Theory]
[InlineData("@user")]
[InlineData("tl")]
+ public async Task Timeline_GetLastModified(string timelineName)
+ {
+ var time = _clock.ForwardCurrentTime();
+
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, await _userService.GetUserIdByUsername("user"));
+
+ var t = await _timelineService.GetTimelineLastModifiedTime(timelineName);
+
+ t.Should().Be(time);
+ }
+
+ [Theory]
+ [InlineData("@user")]
+ [InlineData("tl")]
+ public async Task Timeline_GetUnqiueId(string timelineName)
+ {
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, await _userService.GetUserIdByUsername("user"));
+
+ var uniqueId = await _timelineService.GetTimelineUniqueId(timelineName);
+
+ uniqueId.Should().NotBeNullOrEmpty();
+ }
+
+ [Theory]
+ [InlineData("@user")]
+ [InlineData("tl")]
public async Task Timeline_LastModified(string timelineName)
{
var initTime = _clock.ForwardCurrentTime();