Ejemplo n.º 1
0
        public void TwoPoints()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddMilliseconds(-5123));

            Assert.Equal("5.12 seconds", testSpan.BestText(2));
        }
Ejemplo n.º 2
0
        public void Days()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddDays(-20));

            Assert.Equal("20 days", testSpan.BestText());
        }
Ejemplo n.º 3
0
        public void Milliseonds()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddMilliseconds(-500));

            Assert.Equal("500 milliseconds", testSpan.BestText());
        }
Ejemplo n.º 4
0
        public void HoursAsADay()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddHours(-24));

            Assert.Equal("1 day", testSpan.BestText());
        }
Ejemplo n.º 5
0
        public void SingleDay()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddDays(-1));

            Assert.Equal("1 day", testSpan.BestText());
        }
Ejemplo n.º 6
0
        public void SingleHour()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddHours(-1));

            Assert.Equal("1 hour", testSpan.BestText());
        }
Ejemplo n.º 7
0
        public void Hours()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddHours(-12));

            Assert.Equal("12 hours", testSpan.BestText());
        }
Ejemplo n.º 8
0
        public void Minutes()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddMinutes(-30));

            Assert.Equal("30 minutes", testSpan.BestText());
        }
Ejemplo n.º 9
0
        public void SingleMinute()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddMinutes(-1));

            Assert.Equal("1 minute", testSpan.BestText());
        }
Ejemplo n.º 10
0
        public void Seconds()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddSeconds(-30));

            Assert.Equal("30 seconds", testSpan.BestText());
        }
Ejemplo n.º 11
0
        public void SingleSecond()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddSeconds(-1));

            Assert.Equal("1 second", testSpan.BestText());
        }
Ejemplo n.º 12
0
        public void TwoPointsRoundUp()
        {
            TimeSpan testSpan = (DateTime.Now - DateTime.Now.AddMilliseconds(-5229));

            Assert.Equal("5.23 seconds", testSpan.BestText(2));
        }