Implement automatic retries using UISettingsAttribute#84
Conversation
| private static TValue GetNamedArgument<TValue>(IAttributeInfo factAttribute, IAttributeInfo[] settingsAttributes, string argumentName, Func<TValue, bool> isValidValue, Func<TValue, TValue, TValue>? merge, TValue defaultValue) | ||
| { | ||
| StrongBox<TValue>? result = null; | ||
| if (TryGetNamedArgument(factAttribute, argumentName, isValidValue, out TValue? value)) |
There was a problem hiding this comment.
📝 This was originally designed around having the properties be settable on both the fact attribute (e.g. WinFormsFactAttribute.MaxAttempts) and a separate settings attribute (in this case, UISettingsAttribute). I retained the full logic even though the current implementation only allows the values to be set in one location.
There was a problem hiding this comment.
I've dramatically simplified this class to focus on the feature you're adding.
|
Please merge |
|
|
||
| namespace Xunit; | ||
|
|
||
| public record struct UISettingsKey(int MaxAttempts) |
There was a problem hiding this comment.
This seems like unnecessary new public API. In fact it seems redundant with the attribute, so I dropped the struct entirely.
| private static TValue GetNamedArgument<TValue>(IAttributeInfo factAttribute, IAttributeInfo[] settingsAttributes, string argumentName, Func<TValue, bool> isValidValue, Func<TValue, TValue, TValue>? merge, TValue defaultValue) | ||
| { | ||
| StrongBox<TValue>? result = null; | ||
| if (TryGetNamedArgument(factAttribute, argumentName, isValidValue, out TValue? value)) |
There was a problem hiding this comment.
I've dramatically simplified this class to focus on the feature you're adding.
No description provided.