·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> ASP.NET网站开发 >> [C#]Assert.AreEqualDateTime
示例代码:
[TestMethod()] public void DateTimeFromUnixTimestampMillisTest() { DateTime _actual = UnixEpochHelper.DateTimeFromUnixTimestampMillis(1422949956408); DateTime _expected = new DateTime(2015, 02, 03, 7, 52, 36); Assert.AreEqual(_expected.ToShortDateString(), _actual.ToShortDateString()); Assert.AreEqual(_expected.ToShortTimeString(), _actual.ToShortTimeString()); Assert.AreNotEqual(_expected, _actual); }