Diagnostics for examining logs in automated tests.
Date: Sunday, 1 December, 2024 at 22:12:02 +00:00
TestCaptureLogger<T> class to encapsulate an instance of TestCaptureLogger rather than inherit from it. If your code relied on TestCaptureLogger<T> inheriting from TestCaptureLogger then it will likely break, however an implicit and explicit cast operators were added to mitigate this issue.TestCaptureLoggerProvider.CreateLogger<T>()
TestCaptureLogger<T> no longer inherits from TestCaptureLogger.ITestCaptureLogger and have TestCaptureLogger and TestCaptureLogger<T> be concrete implementations of the interface so you can reference the interface and not care which concrete implementation you have.ITestOutputHelper.
ITestOutputHelper.WriteLogs(ITestCaptureLogger...)ITestOutputHelper.WriteLogs(TestCaptureLoggerProvider...)GetLogs(predicate) to TestCaptureLogger and TestCaptureLoggerProvider.TestCaptureLogger and TestCaptureLogger<T> to compensate for TestCaptureLogger<T> no longer inheriting from TestCaptureLogger
TestCaptureLogger<T> may be implicitly or explicitly cast to TestCaptureLoggerTestCaptureLogger must be explicitly cast to TestCaptureLogger<T>. The cast may fail if the category name used by the TestCaptureLogger does not match the type name of T.