public void GetLastDateOfFiscalYear() { Assert.AreEqual(new DateTime(2018, 3, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 1, 1), 4)); Assert.AreEqual(new DateTime(2019, 3, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 4, 1), 4)); Assert.AreEqual(new DateTime(2019, 3, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 12, 31), 4)); Assert.AreEqual(new DateTime(1, 3, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(1, 1, 1), 4)); Assert.AreEqual(new DateTime(2, 3, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(1, 4, 1), 4)); Assert.AreEqual(new DateTime(9999, 3, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(9999, 3, 1), 4)); Assert.AreEqual(new DateTime(2018, 12, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 1, 1), 1)); Assert.AreEqual(new DateTime(2018, 12, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 4, 1), 1)); Assert.AreEqual(new DateTime(2018, 12, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 12, 31), 1)); Assert.AreEqual(new DateTime(1, 12, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(1, 1, 1), 1)); Assert.AreEqual(new DateTime(1, 12, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(1, 4, 1), 1)); Assert.AreEqual(new DateTime(9999, 12, 31), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(9999, 3, 1), 1)); }
public void GetLastDateOfFiscalYear_Failed3() { Assert.AreEqual(DateTime.MaxValue, DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(9999, 4, 1), 4)); }
public void GetLastDateOfFiscalYear_Failed2() { Assert.AreEqual(new DateTime(2017, 4, 1), DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 1, 1), 13)); }
public void GetLastDateOfFiscalYear_Kind() { Assert.AreEqual(DateTimeKind.Unspecified, DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 1, 1), 4).Kind); Assert.AreEqual(DateTimeKind.Local, DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Local), 4).Kind); Assert.AreEqual(DateTimeKind.Utc, DateTimeUtility.GetLastDateOfFiscalYear(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Utc), 4).Kind); }