c# - Run NUnit test fixture programmatically -
i want perform quick test, , code in linqpad.
so have main()
entry point. can make nunit "run" fixture programmatically there?
using nunit.framework; public class runner { public static void main() { //what do here? } [testfixture] public class foo { [test] public void testsomething() { // test } } }
you can use nunitlite runner:
using nunit.framework; using nunitlite; public class runner { public static int main(string[] args) { return new autorun(assembly.getexecutingassembly()) .execute(new string[] {"/test:runner.foo.testsomething"}); } [testfixture] public class foo { [test] public void testsomething() { // test } } }
here "/run:runner.foo"
specifies text fixture.
mind have reference nunitlite.dll
package well.
Comments
Post a Comment