示例#1
0
        public void DateTimeRounding()
        {
            DateTime input    = new DateTime(2000, 1, 1, 10, 11, 12, 13);
            DateTime expected = new DateTime(2000, 1, 1, 10, 11, 12, 10);

            Assert.AreEqual(expected, AbstractDateTimeType.Round(input, d.TimestampResolutionInTicks));
        }
示例#2
0
 protected virtual DateTime GetTestDate(DateTimeKind kind)
 {
     return(AbstractDateTimeType.Round(
                kind == DateTimeKind.Utc ? DateTime.UtcNow : DateTime.SpecifyKind(DateTime.Now, kind),
                DateAccuracyInTicks)
            // Take another date than now for checking the value do not get overridden by seeding.
            .AddDays(1));
 }
示例#3
0
 protected DateTime RoundForDialect(DateTime value)
 {
     return(AbstractDateTimeType.Round(value, Dialect.TimestampResolutionInTicks));
 }
示例#4
0
 public object Read(AbstractDateTimeType dateTimeType) => TypeConverter.DateTimeEpochStart.AddSeconds(reader.ReadUInt32());