TestSuite GetTestSuite() { var assembly = GetType().GetTypeInfo().Assembly; var builder = new NUnitLiteTestAssemblyBuilder(); return(builder.Build(assembly, new Dictionary <string, object>())); }
public IList <TestSuite> FindTests() { testSuites.Clear(); ITestAssemblyBuilder testSuiteBuilder = new NUnitLiteTestAssemblyBuilder(); TestSuite testSuite; foreach (Assembly assembly in assembliesToTest) { testSuite = testSuiteBuilder.Build(assembly, new Hashtable()); if (testSuite != null) { testSuites.Add(testSuite); } } return(testSuites); }
internal static void Run(string title, Stream outputStream) { var suite = new TestSuite(title); var builder = new NUnitLiteTestAssemblyBuilder(); suite.Add(builder.Build(System.Reflection.Assembly.GetExecutingAssembly(), new Dictionary <string, object>())); var testExecutionContext = TestExecutionContext.CurrentContext; testExecutionContext.WorkDirectory = Environment.CurrentDirectory; var workItem = suite.CreateWorkItem(TestFilter.Empty); workItem.Execute(testExecutionContext); var testWriter = new NUnitLite.Runner.NUnit2XmlOutputWriter(DateTime.Now); using (var writer = new StreamWriter(outputStream)) { testWriter.WriteResultFile(workItem.Result, writer); } }
public void Add(Assembly assembly) { if (assembly == null) { throw new ArgumentNullException("assembly"); } // this can be called many times but we only want to load them // once since we need to share them across most activities if (!Initialized) { var ts = builder.Build(assembly, new Dictionary <string, object>()); if (ts == null) { return; } // TestLoader.Load always return a TestSuite so we can avoid casting many times AndroidRunner.AssemblyLevel.Add(ts); Add(ts); } }
public bool Load(string assemblyName, IDictionary settings) { return(AddSuite(builder.Build(assemblyName, settings ?? empty))); }
public TestSuite LoadAssembly(string assemblyName, IDictionary settings) { return(builder.Build(assemblyName, settings ?? empty)); }