Beispiel #1
0
        [InlineData(-256204778)] // largest number of hours that can be represented in a TimeSpan
        public void TestHours(long hours)
        {
            var ticks = hours * TimeSpan.TicksPerHour;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, string.Format("NumberLong({0})", hours));
        }
Beispiel #2
0
        [InlineData(-922337203685477580, "NumberLong(\"-922337203685477580\")")] // largest number of microseconds that can be represented in a TimeSpan
        public void TestMicroseconds(long microseconds, string jsonValue)
        {
            var ticks = microseconds * __ticksPerMicrosecond;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, jsonValue);
        }
Beispiel #3
0
 [InlineData(-2147483648)] // Int32.MinValue
 public void TestTicks(int ticks)
 {
     TimeSpanSerializerTestsHelper <C> .TestValue(ticks, ticks.ToString());
 }
Beispiel #4
0
        [InlineData(-10675199)] // largest number of Days that can be represented by a TimeSpan
        public void TestDays(long days)
        {
            var ticks = days * TimeSpan.TicksPerDay;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, string.Format("NumberLong({0})", days));
        }
Beispiel #5
0
        [InlineData(-256204778.80152154)] // largest number of hours that can be represented in a TimeSpan
        public void TestHours(double hours)
        {
            var ticks = (long)(hours * TimeSpan.TicksPerHour);

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, hours);
        }
Beispiel #6
0
        [InlineData(-2147483648)] // Int32.MinValue
        public void TestSeconds(int seconds)
        {
            var ticks = seconds * TimeSpan.TicksPerSecond;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, seconds.ToString());
        }
Beispiel #7
0
        [InlineData(-2147483648)] // Int32.MinValue
        public void TestMilliseconds(int milliseconds)
        {
            var ticks = milliseconds * TimeSpan.TicksPerMillisecond;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, milliseconds.ToString());
        }
Beispiel #8
0
        [InlineData(-922337203685, "NumberLong(\"-922337203685\")")] // largest number of seconds that can be represented in a TimeSpan
        public void TestSeconds(long seconds, string jsonValue)
        {
            var ticks = seconds * TimeSpan.TicksPerSecond;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, jsonValue);
        }
Beispiel #9
0
        [InlineData(-10675199)] // largest number of Days that can be represented by a TimeSpan
        public void TestDays(int days)
        {
            var ticks = days * TimeSpan.TicksPerDay;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, days.ToString());
        }
Beispiel #10
0
        [InlineData(-256204778)] // largest number of hours that can be represented in a TimeSpan
        public void TestHours(int hours)
        {
            var ticks = hours * TimeSpan.TicksPerHour;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, hours.ToString());
        }
Beispiel #11
0
        [InlineData(-922337203685.0)] // largest number of seconds that can be represented in a TimeSpan
        public void TestSeconds(double seconds)
        {
            var ticks = (long)(seconds * TimeSpan.TicksPerSecond);

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, seconds);
        }
Beispiel #12
0
        [InlineData(-15372286728.0)] // largest number of minutes that can be represented in a TimeSpan
        public void TestMinutes(double minutes)
        {
            var ticks = (long)(minutes * TimeSpan.TicksPerMinute);

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, minutes);
        }
Beispiel #13
0
        [InlineData(-922337203685477.0)] // largest number of milliseconds that can be represented in a TimeSpan
        public void TestMilliseconds(double milliseconds)
        {
            var ticks = (long)(milliseconds * TimeSpan.TicksPerMillisecond);

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, milliseconds);
        }
Beispiel #14
0
        [InlineData(-15372286728, "NumberLong(\"-15372286728\")")] // largest number of minutes that can be represented in a TimeSpan
        public void TestMinutes(long minutes, string jsonValue)
        {
            var ticks = minutes * TimeSpan.TicksPerMinute;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, jsonValue);
        }
Beispiel #15
0
        [InlineData(-2147483648)] // Int32.MinValue
        public void TestMinutes(int minutes)
        {
            var ticks = minutes * TimeSpan.TicksPerMinute;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, minutes.ToString());
        }
Beispiel #16
0
        [InlineData(-9223372036854775800, "NumberLong(\"-9223372036854775800\")")] // almost Int64.MinValue
        public void TestNanoseconds(long nanoseconds, string jsonValue)
        {
            var ticks = nanoseconds / __nanosecondsPerTick;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, jsonValue);
        }
Beispiel #17
0
        [InlineData(-2147483600)] // almost Int32.MinValue
        public void TestNanoseconds(int nanoseconds)
        {
            var ticks = nanoseconds / __nanosecondsPerTick;

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, nanoseconds.ToString());
        }
Beispiel #18
0
 [InlineData(-9223372036854775808, "\"-10675199.02:48:05.4775808\"")] // long.MinValue
 public void TestTicks(long ticks, string jsonValue)
 {
     TimeSpanSerializerTestsHelper <C> .TestValue(ticks, jsonValue);
 }
Beispiel #19
0
        [InlineData(-10675199.116730064)] // largest number of Days that can be represented by a TimeSpan
        public void TestDays(double days)
        {
            var ticks = (long)(days * TimeSpan.TicksPerDay);

            TimeSpanSerializerTestsHelper <C> .TestValue(ticks, days);
        }