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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -