c# - TestCase display name in NUnit when using Arrays or Generics -
c# - TestCase display name in NUnit when using Arrays or Generics -
i trying utilize testcasesource in nunit run multiple tests 1 of parameters beingness array
private static readonly object[] returnchopcases = { new testcasedata(3, new list<int> {}).returns(-1), new testcasedata(3, new list<int> {1}).returns(1), new testcasedata(1, new list<int> {1,2}).returns(1), }; [testcasesource("returnchopcases")] public int test_chop(int searchnumber, int[] searcharray) { homecoming chopper.chop(3, searcharray); } the problem name displayed in test runner (i'm using nunit test adapter) pretty useless, show test_chop(0,system.int32[]) or if using list test_chop(0,system.collections.generic.list`1[system.int32]).
how retain readable test , give useful test name test in test runner? i've tried few things still name mentioned above.
use setname function name test
new testcasedata(3, new list<int> {}).returns(-1).setname("test_chop_list<int>"), c# arrays generics nunit testcase
Comments
Post a Comment