PageRenderTime 37ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/Framework/src/Ncqrs.Tests/DateTimeBasedClockSpecs.cs

http://github.com/ncqrs/ncqrs
C# | 30 lines | 24 code | 6 blank | 0 comment | 0 complexity | cc2c490be7984fe65d2fd780f3894305 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, Apache-2.0
  1. using System;
  2. using FluentAssertions;
  3. using Xunit;
  4. namespace Ncqrs.Tests
  5. {
  6. public class DateTimeBasedClockSpecs
  7. {
  8. [Fact]
  9. public void When_getting_the_current_time_it_should_be_a_utc_kind()
  10. {
  11. var clock = new DateTimeBasedClock();
  12. var currentTime = clock.UtcNow();
  13. currentTime.Kind.Should().Be(DateTimeKind.Utc);
  14. }
  15. [Fact]
  16. public void When_getting_the_current_time_it_should_be_the_same_as_the_result_from_the_DateTime_class()
  17. {
  18. var clock = new DateTimeBasedClock();
  19. var currentClockTime = clock.UtcNow();
  20. var currentDateTimeTime = DateTime.UtcNow;
  21. currentClockTime.Should().Be(currentDateTimeTime);
  22. }
  23. }
  24. }