c# - How to use multiple TestCaseSource attributes for an N-Unit Test -


how use multiple testcasesource attributes supply test data test in n-unit 2.62?

i'm doing following:

[test, combinatorial, testcasesource(typeof(foofactory), "getfoo"), testcasesource(typeof(barfactory), "getbar")] foobar(foo x, bar y) {  //some test runs here. } 

and test case data sources this:

internal sealed class foofactory {     public ienumerable<foo> getfoo()     {         //gets foos.     } }       internal sealed class barfactory {     public ienumerable<bar> getbar()     {         //gets bars.     } } 

unfortunately, n-unit won't kick off test since says i'm supplying wrong number of arguments. know can specify testcaseobject return type , pass in object array, thought approach possible.

can me resolve this?

the appropriate attribute use in situation valuesource. essentially, specifying data-source individual parameters, so.

public void testquotesubmission([valuesource(typeof(foofactory), "getfoo")]  foo x,  [valuesource(typeof(barfactory), "getbar")] bar y) {     //your test here. } 

this enable type of functionality looking using testcasesource attribute.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -