1717
1818namespace Dibix . Testing
1919{
20- public abstract class TestBase : IDisposable
20+ public abstract class TestBase : ITestContextFacade , IDisposable
2121 {
2222 #region Fields
2323 private readonly Assembly _assembly ;
@@ -265,6 +265,17 @@ private static T SafeGetProperty<T>(ref T field, [CallerMemberName] string prope
265265 }
266266 #endregion
267267
268+ #region ITestContextFacade Members
269+ TestContext ITestContextFacade . TestContext => TestContext ;
270+ TextWriter ITestContextFacade . Out => Out ;
271+ TestClassInstanceScope ITestContextFacade . Scope => Scope ;
272+
273+ string ITestContextFacade . AddTestFile ( string fileName , string content ) => AddTestFile ( fileName , content ) ;
274+ string ITestContextFacade . AddTestRunFile ( string fileName ) => AddTestRunFile ( fileName ) ;
275+
276+ string ITestContextFacade . ImportTestRunFile ( string filePath ) => ImportTestRunFile ( filePath ) ;
277+ #endregion
278+
268279 #region IDisposable Members
269280 public void Dispose ( )
270281 {
@@ -287,7 +298,7 @@ protected virtual void Dispose(bool disposing)
287298 }
288299 #endregion
289300 }
290- public abstract class TestBase < TConfiguration > : TestBase where TConfiguration : class , new ( )
301+ public abstract class TestBase < TConfiguration > : TestBase , ITestContextFacade < TConfiguration > where TConfiguration : class , new ( )
291302 {
292303 private TConfiguration _configuration ;
293304
@@ -318,5 +329,7 @@ private void AddConfigurationToOutput(TConfiguration configuration)
318329 if ( Scope == TestClassInstanceScope . TestInitialize )
319330 _ = AddTestFile ( "appsettings.json" , JsonConvert . SerializeObject ( configuration , Formatting . Indented ) ) ;
320331 }
332+
333+ TConfiguration ITestContextFacade < TConfiguration > . Configuration => Configuration ;
321334 }
322335}
0 commit comments