Ejemplo n.º 1
0
        public void ConvertingFromInfiniteTimeSpanSucceeds()
        {
            var converter = new TimeSpanOrInfiniteConverter();

            var result = converter.ConvertFrom(null, CultureInfo.InvariantCulture, "infinite");

            Assert.AreEqual(Timeout.InfiniteTimeSpan, result);
        }
Ejemplo n.º 2
0
        public void ConvertingFromFormattedTimeSpanSucceeds()
        {
            var converter = new TimeSpanOrInfiniteConverter();

            var result = converter.ConvertFrom(null, CultureInfo.InvariantCulture, "1.23:45:56.789");

            Assert.AreEqual(new TimeSpan(1, 23, 45, 56, 789), result);
        }
Ejemplo n.º 3
0
        public void ConvertingFromNullStringFails()
        {
            var converter = new TimeSpanOrInfiniteConverter();

            var result = converter.ConvertFrom(null, CultureInfo.InvariantCulture, 4);
        }