Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldRemoveLogFromDuplication()
        internal virtual void ShouldRemoveLogFromDuplication()
        {
            // Given
            AssertableLogProvider logProvider = new AssertableLogProvider();
            Log log1 = logProvider.GetLog("log 1");
            Log log2 = logProvider.GetLog("log 2");

            DuplicatingLog log = new DuplicatingLog(log1, log2);

            // When
            log.Info("When the going gets weird");
            log.Remove(log1);
            log.Info("The weird turn pro");

            // Then
            logProvider.AssertExactly(AssertableLogProvider.InLog("log 1").info("When the going gets weird"), AssertableLogProvider.InLog("log 2").info("When the going gets weird"), AssertableLogProvider.InLog("log 2").info("The weird turn pro"));
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldOutputToMultipleLogs()
        internal virtual void ShouldOutputToMultipleLogs()
        {
            // Given
            AssertableLogProvider logProvider = new AssertableLogProvider();
            Log log1 = logProvider.GetLog("log 1");
            Log log2 = logProvider.GetLog("log 2");

            DuplicatingLog log = new DuplicatingLog(log1, log2);

            // When
            log.Info("When the going gets weird");

            // Then
            logProvider.AssertExactly(AssertableLogProvider.InLog("log 1").info("When the going gets weird"), AssertableLogProvider.InLog("log 2").info("When the going gets weird"));
        }