예제 #1
0
        public void Known_Date_Gives_Localized_DateTime_ShortDateString_On_ToString()
        {
            var someDateTime = new DateTime(1992, 4, 6);
            var date         = new UncertainDate(someDateTime, someDateTime);

            Assert.That(date.ToString(), Is.EqualTo(someDateTime.ToShortDateString()));
        }
예제 #2
0
        public void Only_Year_Known_Gives_Year_On_ToString()
        {
            var date = new UncertainDate(1998);

            Assert.That(date.ToString(), Is.EqualTo("1998"));
        }
예제 #3
0
        public void Only_Year_And_Month_Known_Gives_Localized_Monthname_Plus_Year_On_ToString()
        {
            var date = new UncertainDate(1998, 1);

            Assert.That(date.ToString(), Is.EqualTo("January 1998"));
        }
예제 #4
0
        public void Completely_Uncertain_Date_Gives_Question_Mark_On_ToString()
        {
            var date = new UncertainDate();

            Assert.That(date.ToString(), Is.EqualTo("?"));
        }