Skip to content

Commit 460dfd3

Browse files
authored
Merge pull request #264 from clement911/report-tests
Report tests
2 parents e66b1de + 4119e6c commit 460dfd3

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

IPPDotNetDevKitCSV3/Code/Intuit.Ipp.ReportService.Test/ReportServiceTest.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,74 @@ public void ExecuteGetFecReportTest()
8282

8383
}
8484

85+
/// <summary>
86+
/// Profit And Loss report test
87+
/// </summary>
88+
[TestMethod()]
89+
public void ExecuteProfitLossReportTest()
90+
{
91+
try
92+
{
93+
reportServiceTestCases.accounting_method = "Accrual";
94+
reportServiceTestCases.date_macro = "Last Fiscal Year";
95+
Report report = reportServiceTestCases.ExecuteReport("ProfitAndLoss");
96+
Assert.IsNotNull(report);
97+
Assert.AreEqual("ProfitAndLoss", report.Header.ReportName);
98+
Assert.AreEqual(report.Header.ReportBasis.ToString(), reportServiceTestCases.accounting_method);
99+
}
100+
catch (System.Exception ex)
101+
{
102+
Assert.Fail(ex.ToString());
103+
}
104+
105+
}
106+
107+
/// <summary>
108+
/// Journal report test
109+
/// </summary>
110+
[TestMethod()]
111+
public void ExecuteJournalReportTest()
112+
{
113+
try
114+
{
115+
reportServiceTestCases.date_macro = "Last Fiscal Year";
116+
Report report = reportServiceTestCases.ExecuteReport("JournalReport");
117+
Assert.IsNotNull(report);
118+
Assert.AreEqual("JournalReport", report.Header.ReportName);
119+
}
120+
catch (System.Exception ex)
121+
{
122+
Assert.Fail(ex.ToString());
123+
}
124+
125+
}
126+
127+
/// <summary>
128+
/// Transaction Detail By Account test
129+
/// </summary>
130+
[TestMethod()]
131+
public void ExecuteTransactionDetailByAccountReportTest()
132+
{
133+
try
134+
{
135+
reportServiceTestCases.columns = "post";
136+
reportServiceTestCases.transaction_type = "post";
137+
reportServiceTestCases.accounting_method = "Cash";
138+
reportServiceTestCases.sort_by = "create_date";
139+
reportServiceTestCases.sort_order = "descend";
140+
reportServiceTestCases.start_date = DateTime.Today.AddMonths(-1).ToString("yyyy-MM-dd");
141+
reportServiceTestCases.end_date = DateTime.Today.ToString("yyyy-MM-dd");
142+
Report report = reportServiceTestCases.ExecuteReport("TransactionDetailByAccount");
143+
Assert.IsNotNull(report);
144+
Assert.AreEqual("TransactionDetailByAccount", report.Header.ReportName);
145+
Assert.AreEqual(report.Header.ReportBasis.ToString(), reportServiceTestCases.accounting_method);
146+
}
147+
catch (System.Exception ex)
148+
{
149+
Assert.Fail(ex.ToString());
150+
}
151+
152+
}
85153
}
86154

87155
}

0 commit comments

Comments
 (0)