Пример #1
0
        public void GetFirstDateOfMonth()
        {
            Assert.AreEqual(new DateTime(2018, 1, 1), DateTimeUtility.GetFirstDateOfMonth(2018, 1));

            Assert.AreEqual(new DateTime(2018, 1, 1), DateTimeUtility.GetFirstDateOfMonth(new DateTime(2018, 1, 1)));
            Assert.AreEqual(new DateTime(2018, 1, 1), DateTimeUtility.GetFirstDateOfMonth(new DateTime(2018, 1, 10)));
            Assert.AreEqual(new DateTime(2018, 1, 1), DateTimeUtility.GetFirstDateOfMonth(new DateTime(2018, 1, 31)));
        }
Пример #2
0
 public void GetFirstDateOfMonth_Failed2()
 {
     Assert.AreEqual(new DateTime(2018, 1, 1), DateTimeUtility.GetFirstDateOfMonth(2018, 0));
 }
Пример #3
0
 public void GetFirstDateOfMonth_Kind()
 {
     Assert.AreEqual(DateTimeKind.Unspecified, DateTimeUtility.GetFirstDateOfMonth(new DateTime(2018, 1, 1)).Kind);
     Assert.AreEqual(DateTimeKind.Local, DateTimeUtility.GetFirstDateOfMonth(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Local)).Kind);
     Assert.AreEqual(DateTimeKind.Utc, DateTimeUtility.GetFirstDateOfMonth(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Utc)).Kind);
 }