コード例 #1
0
        public void TestValidDateTime()
        {
            DateService ds = new DateService();
            string      s  = ds.DateTimeToString(new DateTime(1970, 1, 1));

            Assert.Equal("1970-01-01", s);
        }
コード例 #2
0
        public void TestInalidDateTime()
        {
            DateService ds = new DateService();

            Assert.Throws <ArgumentOutOfRangeException>(() => ds.DateTimeToString(new DateTime(1970, 13, 1)));
        }
コード例 #3
0
        public void Test29February2021_ThrowsRangeExeception()
        {
            DateService ds = new DateService();

            Assert.Throws <ArgumentOutOfRangeException>(() => ds.DateTimeToString(new DateTime(2021, 02, 29)));
        }