[nunit-discuss] short type in parametrized test

조회수 1회
읽지 않은 첫 메시지로 건너뛰기

Kenneth Xu

읽지 않음,
2010. 5. 12. 오후 12:12:1910. 5. 12.
받는사람 NUnit-Discuss
Hi All,

I guess this is rather a feature request instead of a bug report. But 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.

This is not new to me, I found myself keep making the same mistake. The reason I brought it up today is I got 4th report from developers in our team. So it seems that not only me tumbled on it.

Would it be possible for NUnit to have the TestCase and Values attributes to convert the type based on the method signature?

Thanks,
Kenneth

--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To post to this group, send email to nunit-...@googlegroups.com.
To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.

Charlie Poole

읽지 않음,
2010. 5. 13. 오전 6:06:2910. 5. 13.
받는사람 nunit-...@googlegroups.com
Hi Kenneth,

I agree. You can tag the bug as a feature if you like. In case the value is too large,
I think we should continue with the existing behavior.

Charlie
전체답장
작성자에게 답글
전달
새 메시지 0개