SendInformationalMessage() 공개 메소드

public SendInformationalMessage ( string message ) : void
message string
리턴 void
예제 #1
0
        public void RunAssembly(IFrameworkHandle testLog)
        {
            try
            {
#if LAUNCHDEBUGGER
                System.Diagnostics.Debugger.Launch();
#endif
                if (TryLoadAssembly())
                {
                    using (NUnitEventListener listener = new NUnitEventListener(testLog, TestConverter))
                    {
                        try
                        {
                            runner.Run(listener, NUnitFilter, true, LoggingThreshold.Off);
                        }
                        catch (NullReferenceException)
                        {
                            // this happens during the run when CancelRun is called.
                            logger.SendDebugMessage("Nullref caught");
                        }
                        finally
                        {
                            runner.Unload();
                        }
                    }
                }
                else
                {
                    logger.NoNUnit2TestsFoundIn(assemblyName);
                }
            }
            catch (BadImageFormatException)
            {
                // we skip the native c++ binaries that we don't support.
                logger.AssemblyNotSupportedWarning(assemblyName);
            }
            catch (System.IO.FileNotFoundException ex)
            {
                // Probably from the GetExportedTypes in NUnit.core, attempting to find an assembly, not a problem if it is not NUnit here
                logger.DependentAssemblyNotFoundWarning(ex.FileName, assemblyName);
            }
            catch (UnsupportedFrameworkException ex)
            {
                //The UnsupportedFrameworkException is thrown by nunit, if the assembly references the NUnit v3 framework.
                logger.SendInformationalMessage("Attempt to load assembly with unsupported test framework in " + assemblyName);
            }
            catch (Exception ex)
            {
                logger.SendErrorMessage("Exception thrown executing tests in " + assemblyName, ex);
            }
        }
예제 #2
0
        protected void Info(string method, string function)
        {
            var msg = string.Format("{0} {1} {2} is {3}", Name, adapterVersion, method, function);

            TestLog.SendInformationalMessage(msg);
        }