Parametered test should try to convert data type from source to parameter
Bug #601645 reported by
Kenneth Xu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
Medium
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
Medium
|
Charlie Poole |
Bug Description
This is rather a feature request. Look at below test:
[TestCase(10)] public void TestMethod(short a) { }
That looks quite valid at the first glance but it of cause failed. The right syntax is
[TestCase(
Same problem goes to float type and/or Values attribute.
Would it be possible for NUnit to have the TestCase and Values attributes to convert the type based on the method signature?
tags: | added: feature |
Changed in nunitv2: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunit-3.0: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in nunitv2: | |
status: | In Progress → Fix Committed |
Changed in nunitv2: | |
milestone: | none → 2.5.6 |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
summary: |
- Parametered test should try to convert data type from source to paramter + Parametered test should try to convert data type from source to + parameter |
tags: | added: v2port |
Changed in nunit-3.0: | |
assignee: | nobody → Charlie Poole (charlie.poole) |
milestone: | none → 2.9.5 |
status: | Triaged → Fix Committed |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
NUnit already does conversions but it won't make conversions that
could result in
the truncation of values. So it will convert short to int but not int to short.
We could change that, but I'd like to see what other folks think, so
I'll forward
this request to the mailing list.
Charlie
On Sun, Jul 4, 2010 at 10:08 AM, Kenneth Xu <email address hidden> wrote: (short) 10)] public void TestMethod(short a) { } groups. google. com/group/ nunit- browse_ thread/ thread/ 22898e500f20351 b/ff87c7d3169be 55b?hl= en&lnk= gst&q=short+ type+in+ parametrized+ test+%09% 09%09%09# ff87c7d3169be55 b /bugs.launchpad .net/bugs/ 601645
> Public bug reported:
>
> This is rather a feature request. Look at below test:
>
> [TestCase(10)] public void TestMethod(short a) { }
>
> That looks quite valid at the first glance but it of cause failed. The
> right syntax is
>
> [TestCase(
>
> Same problem goes to float type and/or Values attribute.
>
> Would it be possible for NUnit to have the TestCase and Values
> attributes to convert the type based on the method signature?
>
> See http://
> discuss/
>
> ** Affects: nunitv2
> Importance: Undecided
> Status: New
>
>
> ** Tags: feature
>
> ** Tags added: feature
>
> --
> Parametered test should try to convert data type from source to paramter
> https:/
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>