public void Convert(double timestamp, DateTime expectedDateTime) { Assert.Equal(expectedDateTime, UnixTimestampConverter.ToDateTime(timestamp)); Assert.Equal(timestamp, UnixTimestampConverter.FromDateTime(UnixTimestampConverter.ToDateTime(timestamp)), 3); }
public void TestToDateTime() { DateTime resultDateTime = UnixTimestampConverter.ToDateTime(1585283580); Assert.AreEqual(new DateTime(2020, 3, 27, 4, 33, 0), resultDateTime); }