Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogWhenLoggingThreadStarts()
        public virtual void ShouldLogWhenLoggingThreadStarts()
        {
            // given
            AssertableLogProvider logs    = new AssertableLogProvider();
            AsyncLogging          logging = new AsyncLogging(logs.GetLog("meta"));

            // when
            (new AsyncLogProvider(logging.EventSender(), logs)).getLog("test").info("hello");

            // then
            logs.AssertNoLoggingOccurred();

            // when
            logging.Start();
            logging.Stop();

            // then
            logs.AssertExactly(inLog("test").info(endsWith("hello")));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogMessages()
        public virtual void ShouldLogMessages()
        {
            // given
            AssertableLogProvider logs    = new AssertableLogProvider();
            AsyncLogging          logging = new AsyncLogging(logs.GetLog("meta"));

            // when
            logging.Start();
            try
            {
                (new AsyncLogProvider(logging.EventSender(), logs)).getLog("test").info("hello");
            }
            finally
            {
                logging.Stop();
            }
            // then
            logs.AssertExactly(inLog("test").info(endsWith("hello")));
        }