コード例 #1
0
ファイル: UnitTestSection.cs プロジェクト: daddycoding/Eto
        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));
 }