public void 年月の文字列生成のテスト() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(4); Assert.AreEqual("2013年04月", _mr.getStringYearMonth()); _mr.setMonth(11); Assert.AreEqual("2013年11月", _mr.getStringYearMonth()); _mr.setMonth(3); Assert.AreEqual("2014年03月", _mr.getStringYearMonth()); }
public void 前の月があるかのテスト() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(3); Assert.AreEqual(true, _mr.existsPrevMonth()); _mr.setMonth(1); Assert.AreEqual(true, _mr.existsPrevMonth()); _mr.setMonth(12); Assert.AreEqual(true, _mr.existsPrevMonth()); _mr.setMonth(4); Assert.AreEqual(false, _mr.existsPrevMonth()); }
public void 月カウントアップのテスト() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(11); _mr.incrMonth(); Assert.AreEqual("2013年12月", _mr.getStringYearMonth()); _mr.incrMonth(); Assert.AreEqual("2014年01月", _mr.getStringYearMonth()); // はみ出してもカウントせず、エラーにもならないこと _mr.setMonth(3); _mr.incrMonth(); Assert.AreEqual("2014年03月", _mr.getStringYearMonth()); }
public void カレンダーイヤー計算のテスト() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(4); Assert.AreEqual(2013, _mr.getCalYear()); _mr.setMonth(12); Assert.AreEqual(2013, _mr.getCalYear()); _mr.setMonth(1); Assert.AreEqual(2014, _mr.getCalYear()); _mr.setMonth(2); Assert.AreEqual(2014, _mr.getCalYear()); _mr.setMonth(3); Assert.AreEqual(2014, _mr.getCalYear()); }
public void update(MonthlyReport report, DateTime date) { report.setMonth(updateMonth(date)); financeSystem funds = retrieveFinances(new DateTime(date.Year, date.Month, 1), new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month))); double amountOwedIHSP = 0; double amountOwedOHSP = 0; report.setBasicEnrollNum(funds.numBasicEnrollees); report.setExtendedErollNum(funds.numExtendedEnrollees); report.setBasicTotalIncome(funds.totalBasicIncome); report.setExtendTotalIncome(funds.totalExtendedIncome); report.setTotalEnrolleePayments(funds.numEnrolleeBills); report.setIHSPNumHospBills(funds.numIHSPHospitalBills); report.setOHSPNumHospBills(funds.numOHSPHospitalBills); report.setIHSPNumPhysBills(funds.numIHSPPhysicianBills); report.setOHSPNumPhysBills(funds.numOHSPPhysicianBills); report.setIHSPNumOtherBills(funds.numIHSPOtherBills); report.setOHSPNumOtherBills(funds.numOHSPOtherBills); report.setHospitalIHSP(funds.IHSPhospitalCosts); report.setHospitalOHSP(funds.OHSPhospitalCosts); amountOwedIHSP += funds.IHSPhospitalCosts; amountOwedOHSP += funds.OHSPhospitalCosts; report.setPhysicianIHSP(funds.IHSPPhysicianCosts); report.setPhysicianOHSP(funds.OHSPPhysicianCosts); amountOwedIHSP += funds.IHSPPhysicianCosts; amountOwedOHSP += funds.OHSPPhysicianCosts; report.setOtherIHSP(funds.IHSPOtherCosts); report.setOtherOHSP(funds.OHSPOtherCosts); amountOwedIHSP += funds.IHSPOtherCosts; amountOwedOHSP += funds.OHSPOtherCosts; report.setAmountOwedIHSP(amountOwedIHSP); report.setAmountOwedOHSP(amountOwedOHSP); double paidPercentage = 0; paidPercentage = (amountOwedIHSP + amountOwedOHSP) / (2000 * funds.numIHSPHospitalBills + 150 * funds.numIHSPPhysicianBills + 300 * funds.numIHSPOtherBills + amountOwedOHSP); paidPercentage = paidPercentage * 100; report.setMaxPercentBillable(paidPercentage); double totalCosts = 0; totalCosts += amountOwedIHSP; totalCosts += amountOwedOHSP; report.setTotalCosts(totalCosts); }
public void 正しい日付にセットされているか() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(12); DataSet _ds = _mr.getMonthlyWorkReport(); Assert.AreEqual(1.0, _ds.Tables[this.listTableName].Rows[1]["overtime125"]); }
public void DataSetがカレンダーになっているか() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(12); DataSet _ds = _mr.getMonthlyWorkReport(); Assert.AreEqual(1, _ds.Tables[this.listTableName].Rows[0]["day"]); Assert.AreEqual("日", _ds.Tables[this.listTableName].Rows[0]["week"]); Assert.AreEqual(31, _ds.Tables[this.listTableName].Rows[30]["day"]); Assert.AreEqual(31, _ds.Tables[this.listTableName].Rows.Count); _mr.setMonth(2); _ds = _mr.getMonthlyWorkReport(); Assert.AreEqual(1, _ds.Tables[this.listTableName].Rows[0]["day"]); Assert.AreEqual("土", _ds.Tables[this.listTableName].Rows[0]["week"]); Assert.AreEqual(28, _ds.Tables[this.listTableName].Rows[27]["day"]); Assert.AreEqual(28, _ds.Tables[this.listTableName].Rows.Count); }
public void 深夜勤務合計時間のテスト() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); // 正しい合計時間か _mr.setMonth(12); DataSet _ds = _mr.getMonthlyWorkReport(); Assert.AreEqual("1 h", _mr.getTotalOverTime150Text()); // 合計が0 _mr.setMonth(9); _ds = _mr.getMonthlyWorkReport(); Assert.AreEqual("0 h", _mr.getTotalOverTime150Text()); // 異常系:SQLから取れない場合 MonthlyReport _mr_err = new MonthlyReport(2013, -1); _mr_err.setMonth(12); _ds = _mr_err.getMonthlyWorkReport(); Assert.AreEqual("0 h", _mr.getTotalOverTime150Text()); }
public void ユーザID異常系のテスト() { // コンストラクタで落とす MonthlyReport _mr = new MonthlyReport(2013, -1); // 例外を出さずに返ること Assert.AreEqual("不明なユーザ", _mr.getUserName()); // 例外を出さずに返ること _mr.setMonth(12); DataSet _ds = _mr.getMonthlyWorkReport(); Assert.AreEqual(1, _ds.Tables[this.listTableName].Rows[0]["day"]); }
public void 祝日のデータセットを取得できるか() { int userID = this.getUserID(testLoginNo); MonthlyReport _mr = new MonthlyReport(2013, userID); _mr.setMonth(12); DataSet _ds = _mr.getHolidayListDs(); Assert.AreEqual(1, _ds.Tables[0].Rows[0]["day"]); Assert.AreEqual(7, _ds.Tables[0].Rows[1]["day"]); Assert.AreEqual(8, _ds.Tables[0].Rows[2]["day"]); Assert.AreEqual(12, _ds.Tables[0].Rows.Count); }