首页 > 学院 > 开发设计 > 正文

[C#]Assert.AreEqualDateTime

2019-11-14 16:11:18
字体:
来源:转载
供稿:网友

示例代码:

        [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);        }

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表