-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for JsonTestExecutionReportFormatter
- Loading branch information
Showing
4 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
...otlin/io/github/platan/tests_execution_chart/report/TestExecutionScheduleReportBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
package io.github.platan.tests_execution_chart.report | ||
|
||
import io.github.platan.tests_execution_chart.report.data.Mark | ||
import io.github.platan.tests_execution_chart.report.data.TestExecutionScheduleReport | ||
import io.github.platan.tests_execution_chart.report.data.TimedTestResult | ||
|
||
class TestExecutionScheduleReportBuilder { | ||
private var results = mutableListOf<TimedTestResult>() | ||
fun add( | ||
private var marks = mutableListOf<Mark>() | ||
fun addResult( | ||
className: String?, | ||
testName: String, | ||
startTime: Long, | ||
endTime: Long, | ||
resultType: String, | ||
type: TimedTestResult.Type | ||
) { | ||
): TestExecutionScheduleReportBuilder { | ||
results.add(TimedTestResult(className, testName, startTime, endTime, resultType, type)) | ||
return this | ||
} | ||
|
||
fun getResults(): TestExecutionScheduleReport { | ||
return TestExecutionScheduleReport(results) | ||
fun addMark(name: String, timestamp: Long): TestExecutionScheduleReportBuilder { | ||
marks.add(Mark(name, timestamp)) | ||
return this | ||
} | ||
|
||
fun build(): TestExecutionScheduleReport { | ||
return TestExecutionScheduleReport(results, marks) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters