Skip to content

Commit 6662b93

Browse files
committed
Fix dotnet-trx parsing of tests with custom display names
1 parent 0c4e165 commit 6662b93

File tree

8 files changed

+417
-277
lines changed

8 files changed

+417
-277
lines changed

__tests__/__outputs__/dotnet-trx.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
![Tests failed](https://img.shields.io/badge/tests-3%20passed%2C%203%20failed%2C%201%20skipped-critical)
1+
![Tests failed](https://img.shields.io/badge/tests-5%20passed%2C%205%20failed%2C%201%20skipped-critical)
22
## ❌ <a id="user-content-r0" href="#r0">fixtures/dotnet-trx.trx</a>
3-
**7** tests were completed in **1s** with **3** passed, **3** failed and **1** skipped.
3+
**11** tests were completed in **1s** with **5** passed, **5** failed and **1** skipped.
44
|Test suite|Passed|Failed|Skipped|Time|
55
|:---|---:|---:|---:|---:|
6-
|[DotnetTests.XUnitTests.CalculatorTests](#r0s0)|3✔️|3|1✖️|110ms|
6+
|[DotnetTests.XUnitTests.CalculatorTests](#r0s0)|5✔️|5|1✖️|118ms|
77
### ❌ <a id="user-content-r0s0" href="#r0s0">DotnetTests.XUnitTests.CalculatorTests</a>
88
```
9+
✔️ Custom Name
910
❌ Exception_In_TargetTest
1011
System.DivideByZeroException : Attempted to divide by zero.
1112
❌ Exception_In_Test
@@ -14,8 +15,17 @@
1415
Assert.Equal() Failure
1516
Expected: 3
1617
Actual: 2
18+
✔️ Is_Even_Number(i: 2)
19+
❌ Is_Even_Number(i: 3)
20+
Assert.True() Failure
21+
Expected: True
22+
Actual: False
1723
✔️ Passing_Test
18-
✔️ Passing_Test_With_Name
24+
✔️ Should be even number(i: 2)
25+
❌ Should be even number(i: 3)
26+
Assert.True() Failure
27+
Expected: True
28+
Actual: False
1929
✖️ Skipped_Test
2030
✔️ Timeout_Test
2131
```

__tests__/__outputs__/fluent-validation-test-results.md

+62-62
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@
9191
✔️ When_the_validators_fail_then_the_errors_Should_be_accessible_via_the_errors_property
9292
✔️ When_the_validators_fail_then_validatorrunner_should_return_false
9393
✔️ When_the_Validators_pass_then_the_validatorRunner_should_return_true
94-
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate
95-
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate
96-
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync
97-
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync
94+
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate(preValidationResult: )
95+
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_Validate(preValidationResult: AnotherInt Test Message)
96+
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync(preValidationResult: )
97+
✔️ WhenPreValidationReturnsFalse_ResultReturnToUserImmediatly_ValidateAsync(preValidationResult: AnotherInt Test Message)
9898
✔️ WhenPreValidationReturnsTrue_ValidatorsGetHit_Validate
9999
✔️ WhenPreValidationReturnsTrue_ValidatorsGetHit_ValidateAsync
100100
✔️ WithErrorCode_should_override_error_code
@@ -312,42 +312,42 @@
312312
```
313313
### ✔️ <a id="user-content-r0s15" href="#r0s15">FluentValidation.Tests.EmailValidatorTests</a>
314314
```
315-
✔️ Fails_email_validation_aspnetcore_compatible
316-
✔️ Fails_email_validation_aspnetcore_compatible
317-
✔️ Fails_email_validation_aspnetcore_compatible
318-
✔️ Fails_email_validation_aspnetcore_compatible
319-
✔️ Fails_email_validation_aspnetcore_compatible
320-
✔️ Fails_email_validation_aspnetcore_compatible
321-
✔️ Fails_email_validation_aspnetcore_compatible
322-
✔️ Fails_email_validation_aspnetcore_compatible
323-
✔️ Invalid_email_addressex_regex
324-
✔️ Invalid_email_addressex_regex
325-
✔️ Invalid_email_addressex_regex
326-
✔️ Invalid_email_addressex_regex
327-
✔️ Valid_email_addresses_aspnetcore_compatible
328-
✔️ Valid_email_addresses_aspnetcore_compatible
329-
✔️ Valid_email_addresses_aspnetcore_compatible
330-
✔️ Valid_email_addresses_aspnetcore_compatible
331-
✔️ Valid_email_addresses_aspnetcore_compatible
332-
✔️ Valid_email_addresses_aspnetcore_compatible
333-
✔️ Valid_email_addresses_aspnetcore_compatible
334-
✔️ Valid_email_addresses_aspnetcore_compatible
335-
✔️ Valid_email_addresses_aspnetcore_compatible
336-
✔️ Valid_email_addresses_aspnetcore_compatible
337-
✔️ Valid_email_addresses_aspnetcore_compatible
338-
✔️ Valid_email_addresses_regex
339-
✔️ Valid_email_addresses_regex
340-
✔️ Valid_email_addresses_regex
341-
✔️ Valid_email_addresses_regex
342-
✔️ Valid_email_addresses_regex
343-
✔️ Valid_email_addresses_regex
344-
✔️ Valid_email_addresses_regex
345-
✔️ Valid_email_addresses_regex
346-
✔️ Valid_email_addresses_regex
347-
✔️ Valid_email_addresses_regex
348-
✔️ Valid_email_addresses_regex
349-
✔️ Valid_email_addresses_regex
350-
✔️ Valid_email_addresses_regex
315+
✔️ Fails_email_validation_aspnetcore_compatible(email: " \r \t \n")
316+
✔️ Fails_email_validation_aspnetcore_compatible(email: "")
317+
✔️ Fails_email_validation_aspnetcore_compatible(email: "@someDomain.com")
318+
✔️ Fails_email_validation_aspnetcore_compatible(email: "@[email protected]")
319+
✔️ Fails_email_validation_aspnetcore_compatible(email: "0")
320+
✔️ Fails_email_validation_aspnetcore_compatible(email: "someName")
321+
✔️ Fails_email_validation_aspnetcore_compatible(email: "someName@")
322+
✔️ Fails_email_validation_aspnetcore_compatible(email: "someName@[email protected]")
323+
✔️ Invalid_email_addressex_regex(email: "")
324+
✔️ Invalid_email_addressex_regex(email: "[email protected]")
325+
✔️ Invalid_email_addressex_regex(email: "testperso")
326+
✔️ Invalid_email_addressex_regex(email: "thisisaverylongstringcodeplex.com")
327+
✔️ Valid_email_addresses_aspnetcore_compatible(email: " @someDomain.com")
328+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "!#$%&'*+-/=?^_`|[email protected]")
329+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "\"firstName.lastName\"@someDomain.com")
330+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "[email protected]")
331+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "[email protected]")
332+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "[email protected]")
333+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@some_domain.com")
334+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@some~domain.com")
335+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "[email protected]")
336+
✔️ Valid_email_addresses_aspnetcore_compatible(email: "someName@someDomain￯.com")
337+
✔️ Valid_email_addresses_aspnetcore_compatible(email: null)
338+
✔️ Valid_email_addresses_regex(email: "[email protected]")
339+
✔️ Valid_email_addresses_regex(email: "!def!xyz%[email protected]")
340+
✔️ Valid_email_addresses_regex(email: "\"Abc@def\"@example.com")
341+
✔️ Valid_email_addresses_regex(email: "\"Abc\\@def\"@example.com")
342+
✔️ Valid_email_addresses_regex(email: "\"Fred Bloggs\"@example.com")
343+
✔️ Valid_email_addresses_regex(email: "\"Joe\\Blow\"@example.com")
344+
✔️ Valid_email_addresses_regex(email: "[email protected]")
345+
✔️ Valid_email_addresses_regex(email: "customer/[email protected]")
346+
✔️ Valid_email_addresses_regex(email: "[email protected]")
347+
✔️ Valid_email_addresses_regex(email: "[email protected]")
348+
✔️ Valid_email_addresses_regex(email: "[email protected]")
349+
✔️ Valid_email_addresses_regex(email: "[email protected]")
350+
✔️ Valid_email_addresses_regex(email: null)
351351
```
352352
### ✔️ <a id="user-content-r0s16" href="#r0s16">FluentValidation.Tests.EmptyTester</a>
353353
```
@@ -549,14 +549,14 @@
549549
✔️ Falls_back_to_english_when_culture_not_registered
550550
✔️ Falls_back_to_english_when_translation_missing
551551
✔️ Falls_back_to_parent_culture
552-
✔️ Gets_translation_for_bosnian_latin_culture
553-
✔️ Gets_translation_for_bosnian_latin_culture
554-
✔️ Gets_translation_for_bosnian_latin_culture
552+
✔️ Gets_translation_for_bosnian_latin_culture(cultureName: "bs-Latn-BA")
553+
✔️ Gets_translation_for_bosnian_latin_culture(cultureName: "bs-Latn")
554+
✔️ Gets_translation_for_bosnian_latin_culture(cultureName: "bs")
555555
✔️ Gets_translation_for_croatian_culture
556556
✔️ Gets_translation_for_culture
557-
✔️ Gets_translation_for_serbian_culture
558-
✔️ Gets_translation_for_serbian_culture
559-
✔️ Gets_translation_for_serbian_culture
557+
✔️ Gets_translation_for_serbian_culture(cultureName: "sr-Latn-RS")
558+
✔️ Gets_translation_for_serbian_culture(cultureName: "sr-Latn")
559+
✔️ Gets_translation_for_serbian_culture(cultureName: "sr")
560560
✔️ Gets_translation_for_specific_culture
561561
✔️ Uses_error_code_as_localization_key
562562
```
@@ -1007,16 +1007,16 @@
10071007
✔️ ShouldHaveValidationError_preconstructed_object_does_not_throw_for_unwritable_property
10081008
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_errors_with_preconstructed_object
10091009
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors
1010-
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used
1011-
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used
1010+
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "")
1011+
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: null)
10121012
✔️ ShouldHaveValidationError_should_not_throw_when_there_are_validation_errors_ruleforeach
10131013
✔️ ShouldHaveValidationError_Should_support_nested_properties
10141014
✔️ ShouldHaveValidationError_Should_throw_when_there_are_no_validation_errors
10151015
✔️ ShouldHaveValidationError_should_throw_when_there_are_no_validation_errors_with_preconstructed_object
1016-
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used
1017-
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used
1018-
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used
1019-
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used
1016+
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: "")
1017+
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: "cardNumber")
1018+
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 17, cardNumber: null)
1019+
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_Is_Used(age: 42, cardNumber: "cardNumber")
10201020
✔️ ShouldHaveValidationError_should_throw_when_there_are_not_validation_errors_ruleforeach
10211021
✔️ ShouldHaveValidationError_with_an_unmatched_rule_and_a_single_error_should_throw_an_exception
10221022
✔️ ShouldHaveValidationError_with_an_unmatched_rule_and_multiple_errors_should_throw_an_exception
@@ -1035,23 +1035,23 @@
10351035
✔️ ShouldNotHaveValidationError_Should_support_nested_properties
10361036
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_errors
10371037
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_errors_with_preconstructed_object
1038-
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used
1039-
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used
1040-
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used
1041-
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used
1042-
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used
1043-
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used
1038+
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: "")
1039+
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: "cardNumber")
1040+
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 17, cardNumber: null)
1041+
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_not_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "cardNumber")
1042+
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: "")
1043+
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors__WhenAsyn_is_used(age: 42, cardNumber: null)
10441044
✔️ ShouldNotHaveValidationError_should_throw_when_there_are_validation_errors_ruleforeach
10451045
✔️ Tests_nested_property
10461046
✔️ Tests_nested_property_reverse
10471047
✔️ Tests_nested_property_using_obsolete_method
10481048
✔️ TestValidate_runs_async
10491049
✔️ TestValidate_runs_async_throws
10501050
✔️ Unexpected_error_code_check
1051-
✔️ Unexpected_message_check
1052-
✔️ Unexpected_message_check
1053-
✔️ Unexpected_message_check
1054-
✔️ Unexpected_message_check
1051+
✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["bar"])
1052+
✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["foo", "bar"])
1053+
✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: ["foo"])
1054+
✔️ Unexpected_message_check(withoutErrMsg: "bar", errMessages: [])
10551055
✔️ Unexpected_severity_check
10561056
✔️ Unexpected_state_check
10571057
```

0 commit comments

Comments
 (0)