diff options
author | crupest <crupest@outlook.com> | 2020-08-11 17:59:44 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-08-11 17:59:44 +0800 |
commit | 7df5e63e8b2eaa5b4f83ee72a32eeedd480cde47 (patch) | |
tree | 77e56827955f1e84aaa0ccb8d36969818cfc1640 /Timeline.Tests | |
parent | 4685d69fe965b32438c399a4ad4a3deee9fb0a55 (diff) | |
download | timeline-7df5e63e8b2eaa5b4f83ee72a32eeedd480cde47.tar.gz timeline-7df5e63e8b2eaa5b4f83ee72a32eeedd480cde47.tar.bz2 timeline-7df5e63e8b2eaa5b4f83ee72a32eeedd480cde47.zip |
Post list modified since now consider username change. And make all datetime utc.
Diffstat (limited to 'Timeline.Tests')
-rw-r--r-- | Timeline.Tests/Helpers/TestClock.cs | 4 | ||||
-rw-r--r-- | Timeline.Tests/IntegratedTests/TimelineTest.cs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Timeline.Tests/Helpers/TestClock.cs b/Timeline.Tests/Helpers/TestClock.cs index 0cbf236d..ed2d65a6 100644 --- a/Timeline.Tests/Helpers/TestClock.cs +++ b/Timeline.Tests/Helpers/TestClock.cs @@ -12,7 +12,7 @@ namespace Timeline.Tests.Helpers public DateTime GetCurrentTime()
{
- return _currentTime ?? DateTime.Now;
+ return _currentTime ?? DateTime.UtcNow;
}
public void SetCurrentTime(DateTime? mockTime)
@@ -22,7 +22,7 @@ namespace Timeline.Tests.Helpers public DateTime SetMockCurrentTime()
{
- var time = new DateTime(2000, 1, 1, 1, 1, 1);
+ var time = new DateTime(3000, 1, 1, 1, 1, 1, DateTimeKind.Utc);
_currentTime = time;
return time;
}
diff --git a/Timeline.Tests/IntegratedTests/TimelineTest.cs b/Timeline.Tests/IntegratedTests/TimelineTest.cs index 49672f29..16b3c7e4 100644 --- a/Timeline.Tests/IntegratedTests/TimelineTest.cs +++ b/Timeline.Tests/IntegratedTests/TimelineTest.cs @@ -952,7 +952,7 @@ namespace Timeline.Tests.IntegratedTests .Which.Should().NotBeNull().And.BeEquivalentTo(createRes);
}
const string mockContent2 = "bbb";
- var mockTime2 = DateTime.Now.AddDays(-1);
+ var mockTime2 = DateTime.UtcNow.AddDays(-1);
TimelinePostInfo createRes2;
{
var res = await client.PostAsJsonAsync(generator(1, "posts"),
@@ -1009,7 +1009,7 @@ namespace Timeline.Tests.IntegratedTests .Which.Id;
}
- var now = DateTime.Now;
+ var now = DateTime.UtcNow;
var id0 = await CreatePost(now.AddDays(1));
var id1 = await CreatePost(now.AddDays(-1));
var id2 = await CreatePost(now);
|