示例#1
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsOverOneYear()
        {
            var dateOne = new DateTime(2010, 5, 10);
            var dateTwo = new DateTime(2012, 5, 10);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("over a year", result);
        }
示例#2
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsTenMinutes()
        {
            var dateOne = new DateTime(2012, 5, 10, 17, 20, 30);
            var dateTwo = new DateTime(2012, 5, 10, 17, 30, 30);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("10 minutes", result);
        }
示例#3
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsOneMonth()
        {
            var dateOne = new DateTime(2012, 4, 10);
            var dateTwo = new DateTime(2012, 5, 10);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("about a month", result);
        }
示例#4
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsOneHour()
        {
            var dateOne = new DateTime(2012, 5, 10, 16, 30, 30);
            var dateTwo = new DateTime(2012, 5, 10, 17, 30, 30);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("an hour", result);
        }
示例#5
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsOneDay()
        {
            var dateOne = new DateTime(2012, 5, 9);
            var dateTwo = new DateTime(2012, 5, 10);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("a day", result);
        }
示例#6
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsAFewSeconds()
        {
            var dateOne = new DateTime(2012, 5, 10, 17, 30, 25);
            var dateTwo = new DateTime(2012, 5, 10, 17, 30, 30);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("a few seconds", result);
        }
示例#7
0
        public void TestHumaniseTimeBetweenTwoDatesWhenResultIsAboutFourMonths()
        {
            var dateOne = new DateTime(2012, 1, 10);
            var dateTwo = new DateTime(2012, 5, 10);

            var result = dateOne.HumaniseTimeBetweenTwoDates(dateTwo);

            Assert.AreEqual("about 4 months", result);
        }