Beispiel #1
0
        public void GetFiscalYear()
        {
            Assert.AreEqual(2017, DateTimeUtility.GetFiscalYear(new DateTime(2018, 1, 1), 4));
            Assert.AreEqual(2018, DateTimeUtility.GetFiscalYear(new DateTime(2018, 4, 1), 4));
            Assert.AreEqual(2018, DateTimeUtility.GetFiscalYear(new DateTime(2018, 12, 1), 4));
            Assert.AreEqual(0, DateTimeUtility.GetFiscalYear(new DateTime(1, 1, 1), 4));
            Assert.AreEqual(9998, DateTimeUtility.GetFiscalYear(new DateTime(9999, 1, 1), 4));

            Assert.AreEqual(2018, DateTimeUtility.GetFiscalYear(new DateTime(2018, 1, 1), 1));
            Assert.AreEqual(2018, DateTimeUtility.GetFiscalYear(new DateTime(2018, 4, 1), 1));
            Assert.AreEqual(2018, DateTimeUtility.GetFiscalYear(new DateTime(2018, 12, 1), 1));
            Assert.AreEqual(1, DateTimeUtility.GetFiscalYear(new DateTime(1, 1, 1), 1));
            Assert.AreEqual(9999, DateTimeUtility.GetFiscalYear(new DateTime(9999, 1, 1), 1));
        }
Beispiel #2
0
 public void GetFiscalYear_Failed2()
 {
     Assert.AreEqual(2017, DateTimeUtility.GetFiscalYear(new DateTime(2018, 1, 1), 13));
 }