Пример #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);
        }