Example #1
0
        public void Today_ReturnsToday()
        {
            // Arrange
            StandardDateTimeProvider dateTimeProvider = new StandardDateTimeProvider();
            DateTime controlTime = DateTime.Today;

            // Act
            var result = dateTimeProvider.Today;

            // Assert
            result.Should().Be(controlTime);
            result.Kind.Should().Be(DateTimeKind.Local);
        }
Example #2
0
        public void CurrentUtcDateTime_ReturnsCurrentUtcDateTime()
        {
            // Arrange
            StandardDateTimeProvider dateTimeProvider = new StandardDateTimeProvider();
            DateTime controlTime = DateTime.UtcNow;

            // Act
            var result = dateTimeProvider.CurrentUtcDateTime;

            // Assert
            result.Should().BeCloseTo(controlTime, 100);
            result.Kind.Should().Be(DateTimeKind.Utc);
        }