﻿using System;

namespace NetChris.Common.Clock
{
    /// <summary>
    /// Provides the interface for a clock.
    /// </summary>
    /// <remarks>
    /// This is primarily used to discourage the common use
    /// of <see cref="DateTime.Now"/> or <see cref="DateTime.UtcNow"/>.
    /// While in typical use these nondeterministic results are indeed
    /// desired they are hard to test.
    /// </remarks>
    public interface IClock
    {
        /// <summary>
        /// Gets the time according to the clock.
        /// </summary>
        /// <returns>The time according to the clock.</returns>
        DateTimeOffset GetTime();
    }
}
