diff options
author | crupest <crupest@outlook.com> | 2020-07-12 17:19:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-12 17:19:04 +0800 |
commit | 3eadcdd9a80e4700d1774b6f0935e3102891e077 (patch) | |
tree | 26af588dd559c0ff801106d70c4ba52a4ff6c886 /Timeline.Tests/Services/TimelineServiceTest.cs | |
parent | 712cd6b079138e116a6de5d121b875094087e8a9 (diff) | |
parent | ad187b72edc974e1258a058785d879ba8d8afadf (diff) | |
download | timeline-3eadcdd9a80e4700d1774b6f0935e3102891e077.tar.gz timeline-3eadcdd9a80e4700d1774b6f0935e3102891e077.tar.bz2 timeline-3eadcdd9a80e4700d1774b6f0935e3102891e077.zip |
Merge pull request #116 from crupest/fix-114
Back-end: Timleine If-Modified-Since and checkUniqueId.
Diffstat (limited to 'Timeline.Tests/Services/TimelineServiceTest.cs')
-rw-r--r-- | Timeline.Tests/Services/TimelineServiceTest.cs | 30 |
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();
|