Example #1
0
        public void TestEightDaysAgo(string expected)
        {
            DateTime referenceDateTime = new DateTime(2020, 9, 8, 10, 0, 0);
            var      bg = new DateTimeToHumanReadableFormFormatter();

            Assert.AreEqual(expected, bg.Format(referenceDateTime.AddDays(-8), referenceDateTime));
        }
Example #2
0
        public void TestFiveDaysAgo(string expected)
        {
            var bg = new DateTimeToHumanReadableFormFormatter();

            Assert.AreEqual(expected, bg.Format(DateTime.Now.AddDays(-5), DateTime.Now));
        }
Example #3
0
        public void TestOneHourAgo(string expected)
        {
            var bg = new DateTimeToHumanReadableFormFormatter();

            Assert.AreEqual(expected, bg.Format(DateTime.Now.AddHours(-1), DateTime.Now));
        }