예제 #1
0
    private static void RunTests(Assembly assembly, string[] commandArgs)
    {
        Debug.Log("Running Assembly: " + assembly.FullName);
        if (assembly == null)
        {
            throw new ArgumentNullException("assembly");
        }

        //  if (Tested.Contains(assembly))
        //    return;
        Tested.Add(assembly);

        using (var sw = new StringWriter())
        {
            if (commandArgs != null)
            {
                //var runner = new NunitTextUnityTestUI(sw);
                var runner = new TextUI();
                runner.Execute(commandArgs);
            }
            else
            {
                var runner        = new NUnitStreamUI(sw);
                var resultSummary = runner.Summary;
                var resultText    = sw.GetStringBuilder().ToString();
                Presenter(resultText, resultSummary);
            }
        }
    }
예제 #2
0
    private static void RunTests(Assembly assembly)
    {
        if (assembly == null)
        {
            throw new ArgumentNullException("assembly");
        }

        using (var sw = new StringWriter())
        {
            var runner = new NUnitStreamUI(sw);
            runner.Execute(assembly);
            var resultSummary = runner.Summary;
            var resultText    = sw.GetStringBuilder().ToString();
            Presenter(resultText, resultSummary);
        }
    }
 private static void RunTests(Assembly assembly)
 {
     if (assembly == null)
     {
         throw new ArgumentNullException("assembly");
     }
     if (!Tested.Contains(assembly))
     {
         Tested.Add(assembly);
         using (StringWriter stringWriter = new StringWriter())
         {
             NUnitStreamUI nUnitStreamUI = new NUnitStreamUI(stringWriter);
             nUnitStreamUI.Execute(assembly);
             ResultSummary summary = nUnitStreamUI.Summary;
             string        arg     = stringWriter.GetStringBuilder().ToString();
             Presenter(arg, summary);
         }
     }
 }
예제 #4
0
    private static ResultSummary RunTests(Assembly assembly)
    {
        if (assembly == null)
        {
            throw new ArgumentNullException("assembly");
        }

        if (Tested.Contains(assembly))
        {
            return(null);
        }
        Tested.Add(assembly);

        using (var sw = new StringWriter())
        {
            var runner = new NUnitStreamUI(sw);
            runner.Execute(assembly);
            var resultSummary = runner.Summary;
            var resultText    = sw.GetStringBuilder().ToString();
            Presenter(resultText, resultSummary);
            return(resultSummary);
        }
    }