From a72960e54a89bd31dcb8be8f52e097007dfd23e5 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 20 Nov 2019 00:28:53 +0800 Subject: Clean and refactor tests. --- Timeline.Tests/Helpers/TestClock.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Timeline.Tests/Helpers/TestClock.cs (limited to 'Timeline.Tests/Helpers/TestClock.cs') diff --git a/Timeline.Tests/Helpers/TestClock.cs b/Timeline.Tests/Helpers/TestClock.cs new file mode 100644 index 00000000..12b320d3 --- /dev/null +++ b/Timeline.Tests/Helpers/TestClock.cs @@ -0,0 +1,15 @@ +using System; +using Timeline.Services; + +namespace Timeline.Tests.Helpers +{ + public class TestClock : IClock + { + public DateTime? MockCurrentTime { get; set; } = null; + + public DateTime GetCurrentTime() + { + return MockCurrentTime.GetValueOrDefault(DateTime.Now); + } + } +} -- cgit v1.2.3