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

Notification

Icon
Error

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

Groups: Registered
Joined: 8/7/2017(UTC)
Posts: 2
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 07, 2017 11:35:24 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 622 times
Was thanked: 725 time(s) in 690 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 (2)
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.018 seconds.