File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,18 +13,7 @@ public abstract class TestContextBase : IDisposable
1313 /// <summary>
1414 /// Gets the renderer used by the test context.
1515 /// </summary>
16- public ITestRenderer Renderer
17- {
18- get
19- {
20- if ( testRenderer is null )
21- {
22- testRenderer = Services . GetRequiredService < ITestRenderer > ( ) ;
23- }
24-
25- return testRenderer ;
26- }
27- }
16+ public ITestRenderer Renderer => testRenderer ??= Services . GetRequiredService < ITestRenderer > ( ) ;
2817
2918 /// <summary>
3019 /// Gets the service collection and service provider that is used when a
@@ -90,7 +79,7 @@ protected virtual void Dispose(bool disposing)
9079
9180 // Ignore the async task as GetAwaiter().GetResult() can cause deadlock
9281 // and implementing IAsyncDisposable in TestContext will be a breaking change.
93- //
82+ //
9483 // NOTE: This has to be called before Services.Dispose().
9584 // If there are IAsyncDisposable services registered, calling Dispose first
9685 // causes the service provider to throw an exception.
You can’t perform that action at this time.
0 commit comments