aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/Services
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-03 19:07:35 +0800
committercrupest <crupest@outlook.com>2021-01-03 19:07:35 +0800
commita19b19f866fd85aaae9351bb898ab2898d202a47 (patch)
treeff44340698e19c70ca05b786c9a3c6b1431c823f /BackEnd/Timeline.Tests/Services
parent955704d1e8c3f47b8672cbbd77f4bfb6068fd7b2 (diff)
downloadtimeline-a19b19f866fd85aaae9351bb898ab2898d202a47.tar.gz
timeline-a19b19f866fd85aaae9351bb898ab2898d202a47.tar.bz2
timeline-a19b19f866fd85aaae9351bb898ab2898d202a47.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')
-rw-r--r--BackEnd/Timeline.Tests/Services/BookmarkTimelineServiceTest.cs13
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);
+ }
}
}