/// <summary> /// Releases the unmanaged resources used and optionally disposes of the managed resources. /// </summary> /// <param name="disposing">true to release both managed and unmanaged resources; false to releases only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (disposing) { _provider.Dispose(); _messagesHandler.Dispose(); } }
/// <inheritdoc /> public void Dispose() { Stop(); LoggerProvider?.Dispose(); _servers = null; Endpoints.Clear(); Handlers.Clear(); }
public void DisposeTest() { // Arrange var categoryName = "DarkwingDuck"; // Act var loggerOne = _classUnderTest.CreateLogger(categoryName); _classUnderTest.Dispose(); var loggerTwo = _classUnderTest.CreateLogger(categoryName); // Assert loggerOne.Should().NotBe(loggerTwo); }