diff options
author | crupest <crupest@outlook.com> | 2021-01-03 19:07:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-03 19:07:35 +0800 |
commit | 69d56e560fc280e9a570e858c29878514b1b5575 (patch) | |
tree | 1ac062fa80c8e6886f1eb86a4b1e4c5abc6d953d /BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs | |
parent | 4f301a32778fb006bcf2cc183c7118ca5961f7ba (diff) | |
download | timeline-69d56e560fc280e9a570e858c29878514b1b5575.tar.gz timeline-69d56e560fc280e9a570e858c29878514b1b5575.tar.bz2 timeline-69d56e560fc280e9a570e858c29878514b1b5575.zip |
fix: Fix a critical bug in bookmark timeline service.
It used to create two entry with the same timeline. Now it will not create a duplicate one.
Diffstat (limited to 'BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs')
-rw-r--r-- | BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs b/BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs index 1b8bff63..849936ec 100644 --- a/BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs +++ b/BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs @@ -85,5 +85,18 @@ namespace Timeline.Tests.Services await _service.RemoveBookmark(userId, "t3");
(await _service.GetBookmarks(userId)).Should().BeEmpty();
}
+
+ [Fact]
+ public async Task AddExist_Should_DoNothing()
+ {
+ var userId = await _userService.GetUserIdByUsername("user");
+
+ await _timelineService.CreateTimeline("t", userId);
+
+ await _service.AddBookmark(userId, "t");
+ await _service.AddBookmark(userId, "t");
+
+ (await _service.GetBookmarks(userId)).Should().HaveCount(1);
+ }
}
}
|