예제 #1
0
        public void ToDate_WithValidData_ReturnsCorrectResult(long fileStamp, string expected)
        {
            var expectedDate = DateTime.Parse(expected);

            var result = AssetFileStampHelper.ToDate(fileStamp);

            Assert.Equal(expectedDate, result);
            Assert.Equal(DateTimeKind.Utc, result.Value.Kind);
        }
예제 #2
0
        private static bool IsFileStampValid(long fileStamp, DateTime fileUpdateDate)
        {
            if (fileStamp < 1)
            {
                return(false);
            }

            var fileStampDate = AssetFileStampHelper.ToDate(fileStamp);

            return(fileStampDate.HasValue && fileStampDate.Value.Ticks <= fileUpdateDate.Ticks);
        }
예제 #3
0
        public void ToDate_WithInvalidData_ReturnsNull(long fileStamp)
        {
            var result = AssetFileStampHelper.ToDate(fileStamp);

            Assert.Null(result);
        }