用的xUnit,所有你需要的是實現ITestRunner
接口,即:
public class MyTestRunner : ITestRunner
{
// Methods
public MyTestRunner();
public static TestRunState RunAssembly(TestRunner runner);
public static TestRunState RunClass(TestRunner runner, Type type);
public static TestRunState RunClassWithInnerTypes(TestRunner runner, Type type);
public static TestRunState RunMethod(TestRunner runner, MethodInfo method);
TestRunState ITestRunner.RunAssembly(ITestListener listener, Assembly assembly);
TestRunState ITestRunner.RunMember(ITestListener listener, Assembly assembly, MemberInfo member);
TestRunState ITestRunner.RunNamespace(ITestListener listener, Assembly assembly, string ns);
}
對於實施細節,搶的xUnit的源代碼,並看看樣品亞軍。
不是我真正想要的。我不需要建立一個測試跑步者。我需要在nunits測試跑步者上跑測試。 – 2011-06-12 06:19:34