Skip to content

Add more complicated Enumerable w/ Enumerable tests#41

Merged
tgharold merged 1 commit intomasterfrom
tests-nov-2022-1
Nov 22, 2022
Merged

Add more complicated Enumerable w/ Enumerable tests#41
tgharold merged 1 commit intomasterfrom
tests-nov-2022-1

Conversation

@tgharold
Copy link
Copy Markdown
Owner

@tgharold tgharold commented Nov 22, 2022

Add a test which has a List which contains elements which also have a List of string.

From what I can tell, there's no way for a ValidationAttribute validator to report back on all of the elements that failed validation within a simple IEnumerable<string> list.

At best, you might be able to write a ValidationAttribute validator which reports back on the index of the first failure within the list.

Add a test which has a List which contains elements which also
have a List of string.

From what I can tell, there's no way for a ValidationAttribute validator
to report back on all of the elements that failed validation within a
simple IEnumerable<string> list.  

At best, you might be able to write a ValidationAttribute validator which
reports back on the index of the first failure within the list.
@tgharold
Copy link
Copy Markdown
Owner Author

Benchmark

|                                            Method |      Mean |     Error |    StdDev |    Median |   Gen0 |   Gen1 | Allocated |
|-------------------------------------------------- |----------:|----------:|----------:|----------:|-------:|-------:|----------:|
|  EnumerableExample_PassesAllValidation_NoChildren | 12.276 us | 0.4016 us | 1.1196 us | 12.130 us | 1.0681 | 0.0153 |   4.96 KB |
| EnumerableExample_PassesAllValidation_AllChildren | 81.965 us | 1.8714 us | 5.4294 us | 79.941 us | 7.8125 |      - |   36.8 KB |
|              RecursionExample_PassesAllValidation | 12.197 us | 0.4984 us | 1.4139 us | 11.984 us | 1.1597 |      - |   5.39 KB |
|                 SimpleExample_PassesAllValidation |  7.292 us | 0.2170 us | 0.6295 us |  7.197 us | 0.7401 |      - |   3.41 KB |
|                             SimpleExample_AllNull |  9.198 us | 0.2794 us | 0.8016 us |  9.057 us | 0.8545 |      - |   3.93 KB |
|        SkippedChildrenExample_PassesAllValidation | 14.321 us | 0.3610 us | 1.0358 us | 14.082 us | 1.3123 |      - |   6.04 KB |
|                    SkippedChildrenExample_AllNull | 18.423 us | 0.3992 us | 1.1324 us | 18.129 us | 1.6174 | 0.0305 |   7.56 KB |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant