Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldReturnSameLoggerForSameClass()
        internal virtual void ShouldReturnSameLoggerForSameClass()
        {
            // Given
            DuplicatingLogProvider logProvider = new DuplicatingLogProvider();

            // Then
            DuplicatingLog log = logProvider.getLog(this.GetType());

            assertThat(logProvider.GetLog(typeof(DuplicatingLogProviderTest)), sameInstance(log));
        }
Exemple #2
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"));
        }