TheoryData is a collection type, it implements the old Pattern to initialize it (Add) so it would be convinient if it would support the C#12's collection expression syntax as well.
Currently:
public static TheoryData<string> NumberStrings()
=> new() { string.Empty, "no number", "-12", "0"};
Proposed:
public static TheoryData<string> NumberStrings()
=> [string.Empty, "no number", "-12", "0"];
The implementation would require the implementation of a simple Collection Builder.
The other theoretical advantage to the old pattern is the support of immutable collections, but we don't have that in this case.
What do you think?
TheoryData is a collection type, it implements the old Pattern to initialize it (Add) so it would be convinient if it would support the C#12's collection expression syntax as well.
Currently:
Proposed:
The implementation would require the implementation of a simple Collection Builder.
The other theoretical advantage to the old pattern is the support of immutable collections, but we don't have that in this case.
What do you think?