There's currently a few places in the codebase that NUnit converts types for the purpose of input/output to tests. The ones I've noticed are:
Over time, some of these have drifted out of sync with each other (for example, present master has a TestCaseAttribute which will implicitly convert int -> long, but a RangeAttribute which does not).
Most of these conversion functions all focus on the IConvertible types, and mimic a subset of C#'s implicitly convertible types. Based on recollection from @CharliePoole this was likely added for CompactFramework, and "may" no longer be necessary. #3125 (comment)
At present there's 2 open PRs that incidentally consolidate + remove some of these functions in order to address other issues.
I think if we consolidate other usages, it would both simplify the codebase, as well as facilitate future change (or removal of the implicit C# conversion code, if that's a goal)
There's currently a few places in the codebase that NUnit converts types for the purpose of input/output to tests. The ones I've noticed are:
Over time, some of these have drifted out of sync with each other (for example, present master has a
TestCaseAttributewhich will implicitly convertint->long, but aRangeAttributewhich does not).Most of these conversion functions all focus on the
IConvertibletypes, and mimic a subset of C#'s implicitly convertible types. Based on recollection from @CharliePoole this was likely added for CompactFramework, and "may" no longer be necessary. #3125 (comment)At present there's 2 open PRs that incidentally consolidate + remove some of these functions in order to address other issues.
I think if we consolidate other usages, it would both simplify the codebase, as well as facilitate future change (or removal of the implicit C# conversion code, if that's a goal)