aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/TestClock.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-18 16:21:39 +0800
committercrupest <crupest@outlook.com>2020-06-18 16:21:39 +0800
commitddfd4cedaf696e6ad19f40bec4db0f9d0e28dc65 (patch)
treeb9c9feb7fa9405772eceb5bdfe20ac12f4ccb83d /Timeline.Tests/Helpers/TestClock.cs
parent4a46206ea5f004ecb595de4bfd573b6263ac462b (diff)
downloadtimeline-ddfd4cedaf696e6ad19f40bec4db0f9d0e28dc65.tar.gz
timeline-ddfd4cedaf696e6ad19f40bec4db0f9d0e28dc65.tar.bz2
timeline-ddfd4cedaf696e6ad19f40bec4db0f9d0e28dc65.zip
Add last modified info to timeline.
Diffstat (limited to 'Timeline.Tests/Helpers/TestClock.cs')
-rw-r--r--Timeline.Tests/Helpers/TestClock.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/TestClock.cs b/Timeline.Tests/Helpers/TestClock.cs
new file mode 100644
index 00000000..7febc0fe
--- /dev/null
+++ b/Timeline.Tests/Helpers/TestClock.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Timeline.Services;
+
+namespace Timeline.Tests.Helpers
+{
+ public class TestClock : IClock
+ {
+ private DateTime? _currentTime = null;
+
+ public DateTime GetCurrentTime()
+ {
+ return _currentTime ?? DateTime.Now;
+ }
+
+ public void SetCurrentTime(DateTime? mockTime)
+ {
+ _currentTime = mockTime;
+ }
+ }
+}