Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

DataTestMethod, NCrunch too strict?
Kaerwek
#1 Posted : Monday, August 7, 2017 9:12:44 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/7/2017(UTC)
Posts: 23
Location: Finland

I've noticed that DataTestMethods with actual integers in the DataRows fail if the test is specified to type Double.

Running the same test in Visual Studio native testrunner they pass just fine. But in NCrunch, I have to amend the tests and add a '.0' to make them doubles.

E.g.

[DataTestMethod]
[DataRow(1)]
public void TestMe(double input)

Is not the objective of NCrunch to be as lenient as other test runners when executing tests? It diminishes the value of NCrunch when I have to either amend these or filter them out to find out if any tests are really broken.
Remco
#2 Posted : Monday, August 7, 2017 11:35:24 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Kaerwek;10930 wrote:

Is not the objective of NCrunch to be as lenient as other test runners when executing tests? It diminishes the value of NCrunch when I have to either amend these or filter them out to find out if any tests are really broken.


Yes, it is. Unfortunately, there is no defined specification that details things like this in test frameworks. NCrunch's support for MSTest is emulated rather than integrated, which means that there is the potential for edge cases like this to be missed when providing support. These features are still very new in MSTest, so they haven't gone through the same rigorous real-world testing as other features.

I've noted this down to be investigated. For the time being, I recommend making sure you declare parameters as being of the same type as those specified on the method signature.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.024 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download