c# - Is there any way to use NUnit TestCaseAttribute with ValuesAttribute together? -
i using intensively nunit testcase attribute. of tests annotated 20+ testcase attributes defining 20+ test cases. test 20 test cases value 1 or 0. means me different test cases. implemented valuesattribute:
my current state:
[testcase(10, "hello", false)] // 1 [testcase(33, "bye", true)] // 2 // imagine 20+ testcase here)] [testcase(55, "cul8r", true)] // 20+ public void mytest(int number, string text, bool result)
i similar (what can not:)
[testcase(10, "hello", false)] // 1 [testcase(33, "bye", true)] // 2 // imagine 20+ testcase here)] [testcase(55, "cul8r", true)] // 20+ public void mytest([values(0,1)] int anyname, int number, string text, bool result)
why this? because these 40+ combination means different test cases. unfortunatelly nunit not allow using [testcase] , [values] attributes together, test runner expects exactly same number of parameters listed in testcaseattribute. (i can understand architect, still...) thing figure out this:
[testcase(1, 10, "hello", false] // 1 [testcase(1, 33, "bye", true] // 2 // imagine 20+ testcase here] [testcase(1, 55, "cul8r", true] // 20 [testcase(0, 10, "hello", false] // 21 [testcase(0, 33, "bye", true] // 22 // imagine 20+ testcase here] [testcase(0, 55, "cul8r", true] // 40 public void mytest(int anyname, int number, string text, bool result)
so ended forced commit sin of copy , paste, , duplicated testcases, have 40+. there must way... if not (0,1) range of value 0,1,2,3. ending 80+ copied testcases?
missed something?
thx in advance
Comments
Post a Comment