public IActionResult Json() { return(Json(new { Id = 1, // real UTC datetime UtcDate = DateTime.UtcNow.ToString(), // UTC datetime converted by DateTimeConverter UtcDateConvertedByDateTimeConverter = DateTime.UtcNow, // user local time LocalTime = _userCulture.GetUserLocalTime() })); }
public void ReturnUserLocalTime() { _mockedTimeService.SetupGet(x => x.Now).Returns(_utcTime); Assert.Equal(_userLocalTime, _sut.GetUserLocalTime()); }