nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #00826
[Bug 601645] Re: Parametered test should try to convert data type from source to parameter
** Summary changed:
- 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
--
Parametered test should try to convert data type from source to parameter
https://bugs.launchpad.net/bugs/601645
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
Status in NUnit Test Framework: Triaged
Status in NUnit V2 Test Framework: Fix Released
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((short)10)] public void TestMethod(short a) { }
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://groups.google.com/group/nunit-discuss/browse_thread/thread/22898e500f20351b/ff87c7d3169be55b?hl=en&lnk=gst&q=short+type+in+parametrized+test+%09%09%09%09#ff87c7d3169be55b
References