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

Notification

Icon
Error

DataTestMethod with Enumerators fail in NCrunch
Kaerwek
#1 Posted : Monday, August 07, 2017 8:05:11 AM(UTC)
Rank: Newbie

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

We're using DataTestMethods with enumerators, e.g.

[DataTestMethod]
[DataRow(AlignmentX.Center, "middle", DisplayName = "Returns \"middle\" for given AlignmentX = Center")]
[DataRow(AlignmentX.Left, "start", DisplayName = "Returns \"start\" for given AlignmentX = Left")]
[DataRow(AlignmentX.Right, "end", DisplayName = "Returns \"end\" for given AlignmentX = Right")]
public void Test(object input, string expected)

The tests fail because NCrunch converts the chosen enumerator to the backend value. When entering a breakpoint in debugger mode on first line, I see that input is an integer, 2, in the first case.

If I had a test that only tested for AlignmentX, I could perhaps code past it, but currently I have loads of other datarows and datatypes. Forcing everyone in the organization (since all dont use NCrunch), to create specific tests for DataTestMethods that use a specific enumerator isn't really feasible either.


Is this a known issue?
Remco
#2 Posted : Monday, August 07, 2017 8:09:41 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)
Hi,

Thanks for sharing this issue.

Until now, I was not aware of this issue, but it does make sense that it could exist. There is some complexity in the handling of DataRow parameters, and you've managed to find an alignment hole.

I'll see what I can do about getting this fixed in the next build.
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.018 seconds.