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
Post a Comment