public void TestInc() { for (int y = 1; y <= 10; y++) { for (int m = 1; m <= 12; m++) { for (int d = 1; d <= 30; d++) { Assert.AreEqual(d, date.day); Assert.AreEqual(m, date.month); Assert.AreEqual(y, date.year); Assert.AreEqual(d + (m - 1) * 30 + (y - 1) * 360, date.total_days); Assert.AreEqual($"{y}-{m}-{d}", date.desc); date.Inc(); } } } }
public void Test_EconomyDayInc() { var date = new GMData.Run.Date(GMRoot.initData.start_date); economy.detail.popTax = 200; economy.detail.reportChaoting = 10; economy.detail.adminSpend = 20; var curr = (decimal)GMRoot.define.economy.curr; for (int i = 1; i <= 360 * 10; i++) { if (i % 30 == 0) { curr += economy.monthSurplus; } economy.DaysInc(date); date.Inc(); Assert.AreEqual(curr, economy.curr); } }