For a new project I noticed that when I write something along the following lines (I often use FsUnit, but it is the same idea):
public class TC
{
public int Id;
public Guid guid;
public string name;
}
internal static TestCaseData[] CreateTestOrders
{
get
{
return new[]
{
new TestCaseData(new TC { Id = 123, guid = new Guid("73C9B241-11C3-4DBD-9EB8-E7BDE7A2D8DD"), name = "John" })
.SetName("123"),
new TestCaseData(new TC { Id = 456, guid = new Guid("01020304-11C3-4DBD-9EB8-E7BDE7A2D8DD"), name = "Anton" })
.SetName("456"),
new TestCaseData(new TC { Id = 789, guid = new Guid("02040608-11C3-4DBD-9EB8-E7BDE7A2D8DD"), name = "Josh" })
.SetName("789"),
new TestCaseData(new TC { Id = 036, guid = new Guid("12131415-11C3-4DBD-9EB8-E7BDE7A2D8DD"), name = "Jonathan" })
.SetName("036")
};
}
}
[Test, TestCaseSource("CreateTestOrders")]
public void TestOrderId(TC tc)
{
Assert.AreEqual(123, tc.Id);
}
[Test, TestCaseSource("CreateTestOrders")]
public void TestOrderPersonDetails(TC tc)
{
Assert.Contains(tc.name, new[] { "John", "Anton", "Josh" });
}... then I end up with four tests, not eight, in NCrunch. In NUnit test runner (the local windows tool) I see the tests grouped by namespace, classname, methodname and finally testname. In NCrunch I do not have the possibility to select methodname and instead of showing duplicates, it simply throws them away.
How can I get my tests back (if at all, and if not possible, can you consider this a bug report / feature request)? For this new project I can cater for unique names, but with some other projects, they have together close to I think 50k of test cases and it is simply undoable to find and fix all cases of duplicates, if not only because auto-generation makes it non-trivial to fix.