Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldBulkOutputToMultipleLogs()
        internal virtual void ShouldBulkOutputToMultipleLogs()
        {
            // 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.Bulk(bulkLog => bulkLog.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"));
        }
Example #2
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 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldRemoveLogProviderFromDuplication()
        internal virtual void ShouldRemoveLogProviderFromDuplication()
        {
            // Given
            AssertableLogProvider logProvider1 = new AssertableLogProvider();
            AssertableLogProvider logProvider2 = new AssertableLogProvider();

            DuplicatingLogProvider logProvider = new DuplicatingLogProvider(logProvider1, logProvider2);

            // When
            Log log = logProvider.getLog(this.GetType());

            log.Info("When the going gets weird");
            assertTrue(logProvider.Remove(logProvider1));
            log.Info("The weird turn pro");

            // Then
            logProvider1.AssertExactly(AssertableLogProvider.inLog(this.GetType()).Info("When the going gets weird"));
            logProvider2.AssertExactly(AssertableLogProvider.inLog(this.GetType()).Info("When the going gets weird"), AssertableLogProvider.inLog(this.GetType()).Info("The weird turn pro"));
        }