예제 #1
0
        TestSuite GetTestSuite()
        {
            var assembly = GetType().GetTypeInfo().Assembly;
            var builder  = new NUnitLiteTestAssemblyBuilder();

            return(builder.Build(assembly, new Dictionary <string, object>()));
        }
예제 #2
0
        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);
        }
예제 #3
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;

            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);
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
 public bool Load(string assemblyName, IDictionary settings)
 {
     return(AddSuite(builder.Build(assemblyName, settings ?? empty)));
 }
예제 #6
0
 public TestSuite LoadAssembly(string assemblyName, IDictionary settings)
 {
     return(builder.Build(assemblyName, settings ?? empty));
 }