File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
src/LiquidTestReports.Core
test/LiquidTestReports.Cli.Tests Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ liquid [options]
4646
4747 ** --inputs [ inputs] ** Array of formatted configuration strings for test report inputs, with configurations separated by a semicolon
4848 - ** File=file-name;** The path of the input file.
49+ - ** Format=report-format;** Optional input report format, case insensitive, supported values are ` Trx ` of ` JUnit ` . Defaults to ` Trx ` .
4950 - ** GroupTitle=group-title;** Optional title to group reports under, test runs with the same group title will be merged.
5051 - ** TestPrefix=test-prefix;** Optional test suffix, if provided test origination for the provided report will have the suffix appended to its name.
5152
Original file line number Diff line number Diff line change 77
88namespace LiquidTestReports . Core . Mappers
99{
10+ /// <summary>
11+ /// Mapping for deserialised JUnit types to drop model types
12+ /// </summary>
1013 public static class JUnitMapper
1114 {
15+ /// <summary>
16+ /// Maps result types from JUnit into instance of drop models with configuration
17+ /// </summary>
18+ /// <param name="source">Instance of test results from deserialised JUnit input</param>
19+ /// <param name="destination">Instance to map and merge results into</param>
20+ /// <param name="inputConfiguration">User configured input for current source</param>
1221 public static void Map ( Testsuites source , TestRunDrop destination , ReportInput inputConfiguration = null )
1322 {
1423 foreach ( var testsuite in source . Testsuite )
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public ReportInput(string inputString)
5454
5555 if ( parameters . TryGetValue ( nameof ( Format ) , out var format ) )
5656 {
57- Format = Enum . TryParse < InputFormatType > ( format , out var formatType )
57+ Format = Enum . TryParse < InputFormatType > ( format , true , out var formatType )
5858 ? formatType
5959 : InputFormatType . Unknown ;
6060 }
Original file line number Diff line number Diff line change @@ -98,16 +98,16 @@ public void Main_WithTitle_GeneratesReport()
9898 public void Main_JUnitWithTitle_GeneratesReport ( )
9999 {
100100 //Arrange
101- var title = "My JUnit + TRX Tests " ;
101+ var title = "My Full Stack Test Report ( JUnit + TRX) " ;
102102 var titleTest = "junitTest.md" ;
103103 var destinationReport = new FileInfo ( Path . Combine ( _outputFolder , titleTest ) ) ;
104104 var files = new List < ReportInput > ( ) ;
105105
106- foreach ( var file in new DirectoryInfo ( Path . Combine ( Environment . CurrentDirectory , _inputJUnitDirectory ) ) . GetFiles ( "* netcoreapp3.1-junit-sample.xml" ) )
107- files . Add ( new ReportInput ( $ "File={ file } ;Format=JUnit;TestSuffix= ( JUnit) ") ) ;
106+ foreach ( var file in new DirectoryInfo ( Path . Combine ( Environment . CurrentDirectory , _inputJUnitDirectory ) ) . GetFiles ( "xUnit- netcoreapp3.1-junit-sample.xml" ) )
107+ files . Add ( new ReportInput ( $ "File={ file } ;Format=JUnit;GroupTitle= JUnit Tests ") ) ;
108108
109- foreach ( var file in new DirectoryInfo ( Path . Combine ( Environment . CurrentDirectory , _inputTrxDirectory ) ) . GetFiles ( "* netcoreapp3.1-sample.xml " ) )
110- files . Add ( new ReportInput ( $ "File={ file } ;Format=Trx;TestSuffix= ( Trx) ") ) ;
109+ foreach ( var file in new DirectoryInfo ( Path . Combine ( Environment . CurrentDirectory , _inputTrxDirectory ) ) . GetFiles ( "xUnit- netcoreapp3.1-sample.trx " ) )
110+ files . Add ( new ReportInput ( $ "File={ file } ;Format=Trx;GroupTitle= Trx Tests ") ) ;
111111
112112 // Act
113113 Program . Main ( files . ToArray ( ) , destinationReport , title ) ;
You can’t perform that action at this time.
0 commit comments