示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testApplicationCsvDurationReportByQuarter()
        public virtual void testApplicationCsvDurationReportByQuarter()
        {
            Response response = given().queryParam("reportType", "duration").queryParam("periodUnit", "quarter").accept("application/csv").then().expect().statusCode(Status.OK.StatusCode).contentType("application/csv").header("Content-Disposition", "attachment; filename=process-instance-report.csv").when().get(HISTORIC_PROCESS_INSTANCE_REPORT_URL);

            string responseContent = response.asString();

            assertTrue(responseContent.Contains(ReportResultToCsvConverter.DURATION_HEADER));
            assertTrue(responseContent.Contains(QUARTER.ToString()));
            assertTrue(responseContent.Contains(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_AVG.ToString()));
            assertTrue(responseContent.Contains(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MIN.ToString()));
            assertTrue(responseContent.Contains(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MAX.ToString()));
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDurationReportByQuarter()
        public virtual void testDurationReportByQuarter()
        {
            Response response = given().queryParam("periodUnit", "quarter").queryParam("reportType", "duration").then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).when().get(HISTORIC_PROCESS_INSTANCE_REPORT_URL);

            string         content = response.asString();
            IList <string> reports = from(content).getList("");

            Assert.assertEquals("There should be one report returned.", 1, reports.Count);
            Assert.assertNotNull("The returned report should not be null.", reports[0]);

            long   returnedAvg        = from(content).getLong("[0].average");
            long   returnedMax        = from(content).getLong("[0].maximum");
            long   returnedMin        = from(content).getLong("[0].minimum");
            int    returnedPeriod     = from(content).getInt("[0].period");
            string returnedPeriodUnit = from(content).getString("[0].periodUnit");

            Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_AVG, returnedAvg);
            Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MAX, returnedMax);
            Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MIN, returnedMin);
            Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_PERIOD, returnedPeriod);
            Assert.assertEquals(QUARTER.ToString(), returnedPeriodUnit);
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testTaskDurationReportByQuarter()
        public virtual void testTaskDurationReportByQuarter()
        {
            given().queryParam("periodUnit", "quarter").queryParam("reportType", "duration").then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).body("[0].average", equalTo((int)EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_AVG)).body("[0].maximum", equalTo((int)EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_MAX)).body("[0].minimum", equalTo((int)EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_MIN)).body("[0].period", equalTo(EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_PERIOD)).body("[0].periodUnit", equalTo(QUARTER.ToString())).when().get(TASK_REPORT_URL);

            verify(mockedReportQuery).duration(PeriodUnit.QUARTER);
            verifyNoMoreInteractions(mockedReportQuery);
        }