Skip to content

Consolidate type conversion code  #3219

@stevenaw

Description

@stevenaw

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions