aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/TestClock.cs
blob: 7febc0fecf48e1683143863f0e30423ba0a19405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
        }
    }
}