示例#1
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);
         }
     }
 }
示例#3
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);
        }
    }