Example #1
0
        public void GetLastDateOfYear()
        {
            Assert.AreEqual(new DateTime(2018, 12, 31), DateTimeUtility.GetLastDateOfYear(2018));

            Assert.AreEqual(new DateTime(2018, 12, 31), DateTimeUtility.GetLastDateOfYear(new DateTime(2018, 1, 1)));
            Assert.AreEqual(new DateTime(2018, 12, 31), DateTimeUtility.GetLastDateOfYear(new DateTime(2018, 12, 31)));
        }
Example #2
0
 public void GetLastDateOfYear_Failed()
 {
     Assert.AreEqual(new DateTime(2018, 1, 1), DateTimeUtility.GetLastDateOfYear(0));
 }
Example #3
0
 public void GetLastDateOfYear_Kind()
 {
     Assert.AreEqual(DateTimeKind.Unspecified, DateTimeUtility.GetLastDateOfYear(new DateTime(2018, 1, 1)).Kind);
     Assert.AreEqual(DateTimeKind.Local, DateTimeUtility.GetLastDateOfYear(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Local)).Kind);
     Assert.AreEqual(DateTimeKind.Utc, DateTimeUtility.GetLastDateOfYear(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Utc)).Kind);
 }