using eSuite.Core.Clock;
using NUnit.Framework;

namespace eSuite.Core.UnitTests;

[TestFixture]
public class UtcClockUnitTests
{
    private UtcClock _utcClock = null!;

    [SetUp]
    public void Setup()
    {
        _utcClock = new UtcClock();
    }

    [Test]
    public void GetNow_Called_ReturnsUTCNow()
    {
        //Arrange
        var currentDateTime = DateTimeOffset.UtcNow;

        //Act
        var now = _utcClock.GetNow;

        //Assert
        Assert.That(now, Is.GreaterThan(currentDateTime));
        Assert.That(now, Is.LessThan(currentDateTime.AddSeconds(1)));
    }
}