DefaultTestAssemblyBuilder loads a single assembly and builds a TestSuite containing test fixtures present in the assembly.
Inheritance: ITestAssemblyBuilder
Beispiel #1
0
        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;

            #if __IOS__
            var workItem = suite.CreateWorkItem(TestFilter.Empty, new FinallyDelegate());
            #else
            var workItem = suite.CreateWorkItem(TestFilter.Empty);
            #endif
            workItem.Execute(testExecutionContext);

            var testWriter = new NUnitLite.Runner.NUnit2XmlOutputWriter(DateTime.Now);
            using (var writer = new StreamWriter(outputStream))
            {
                testWriter.WriteResultFile(workItem.Result, writer);
            }
        }
Beispiel #2
0
		TestSuite GetTestSuite()
		{
			var assembly = GetType().GetTypeInfo().Assembly;
			var builder = new NUnitLiteTestAssemblyBuilder();
			return builder.Build(assembly, new Dictionary<string, object>());
		}