예제 #1
0
        public void EpochMilleniumDateToEpochFromDateTimeTest()
        {
            DateTime value = new DateTime(2000, 1, 1, 0, 0, 0);
            double result = value.ToEpochFromDateTime();

            const double ExpectedValue = 946684800.0;

            Assert.AreEqual(ExpectedValue, result);
        }
예제 #2
0
        public void EpochNegativeToEpochFromDateTimeTest()
        {
            DateTime value = new DateTime(1969, 1, 1, 0, 0, 0);
            double result = value.ToEpochFromDateTime();

            Assert.IsTrue(result < 0);
        }
예제 #3
0
 public void ZeroEpochDateToEpochStringTest()
 {
     DateTime? value = new DateTime(1970, 1, 1, 0, 0, 0);
     double? result = value.ToEpochFromDateTime();
     Assert.IsTrue(result.HasValue);
     Assert.AreEqual(0, result.Value);
 }
예제 #4
0
 public void MilleniumEpochDateToEpochStringTest()
 {
     DateTime? value = new DateTime(2000, 1, 1, 0, 0, 0);
     double? result = value.ToEpochFromDateTime();
     Assert.AreEqual(946684800, result);
 }
예제 #5
0
        public void EpochZeroToEpochFromDateTimeTest()
        {
            DateTime value = new DateTime(1970, 1, 1, 0, 0, 0);
            double result = value.ToEpochFromDateTime();

            Assert.AreEqual(0, result);
        }
예제 #6
0
        public void EpochPositiveToEpochFromDateTimeTest()
        {
            DateTime value = new DateTime(1971, 1, 1, 0, 0, 0);
            double result = value.ToEpochFromDateTime();

            Assert.IsTrue(result > 0);
        }