コード例 #1
0
        public void HorologDate_ShouldConvertToHorologDate()
        {
            int      expectedHorologDate = 60023;
            DateTime expectedDateTime    = new DateTime(2005, 5, 3);

            int actual = InternalCacheUtilities.DateTimeToHorologDate(expectedDateTime);

            Assert.AreEqual(expectedHorologDate, actual);
        }
コード例 #2
0
        public void LogicalDate_ShouldConvertToLogicalDate()
        {
            string   expectedLogical  = "2950425";
            DateTime expectedDateTime = new DateTime(1995, 4, 25);

            string actual = InternalCacheUtilities.DateTimeToLogicalDate(expectedDateTime);

            Assert.AreEqual(expectedLogical, actual);
        }
コード例 #3
0
        public void HorologDate_DayOne_ShouldConvertToHorologDate()
        {
            int      expectedHorologDate = 1;
            DateTime expectedDateTime    = new DateTime(1841, 1, 1);

            int actual = InternalCacheUtilities.DateTimeToHorologDate(expectedDateTime);

            Assert.AreEqual(expectedHorologDate, actual);
        }
コード例 #4
0
        /// <summary>
        /// Returns the value for the column/property from the supplied entity
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override object GetValue(object entity)
        {
            object value = base.GetValue(entity);

            if (value is DateTime time)
            {
                return(InternalCacheUtilities.DateTimeToHorologDate(time));
            }
            return(value);
        }