Theory with Type for argument unable to resolve #2508
Replies: 3 comments 2 replies
-
The issue with the provided Theory may be due to the fact that Type is not a serializable type, and therefore may not be properly handled during the test discovery process. One possible workaround could be to instead pass the fully-qualified name of the type as a string, and then use reflection to obtain the actual Type object within the test method. For example:
Alternatively, a custom TypeConverter could be used to convert the string representation of the type to the actual Type object. |
Beta Was this translation helpful? Give feedback.
-
Serializable in terms of what exactly? I'm not sure I understand. Been a little while since I noticed this, but IIRC, I am using So therefore it is there as nothing more than an anchor, placeholder, key, along these lines. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I'll have a gander at those options as well. |
Beta Was this translation helpful? Give feedback.
-
Maybe this is more of an issue, I do not know. I have a
Theory
something like this:Where:
However, it seems that in
VS2022
at any rate discovery never finishes.Is there a better way to convey this, maybe I need a wrapper that has a better stringification?
Thank you...
Beta Was this translation helpful? Give feedback.
All reactions