@@ -61,22 +61,26 @@ internal TestOutputWriter TestOutputHelper
6161 /// It might be desired to keep the test output even if all tests have passed, i.E. for investigation purposes.
6262 /// Setting this property to true, will store the output in the temp directory, so they are still available after each run.
6363 /// </summary>
64+ #if CI_BUILD
6465 protected virtual bool UseDedicatedTestResultsDirectory => true ;
66+ #else
67+ protected virtual bool UseDedicatedTestResultsDirectory => false ;
68+ #endif
6569 private TestResultComposer TestResultComposer
6670 {
6771 get => SafeGetProperty ( ref this . _testResultComposer ) ;
6872 set => this . _testResultComposer = value ;
6973 }
70- #endregion
74+ #endregion
7175
72- #region Constructor
76+ #region Constructor
7377 protected TestBase ( )
7478 {
7579 this . _assembly = this . GetType ( ) . Assembly ;
7680 }
77- #endregion
81+ #endregion
7882
79- #region Public Methods
83+ #region Public Methods
8084 [ TestInitialize ]
8185 public async Task OnTestInitialize ( )
8286 {
@@ -86,9 +90,9 @@ public async Task OnTestInitialize()
8690
8791 await this . OnTestInitialized ( ) . ConfigureAwait ( false ) ;
8892 }
89- #endregion
93+ #endregion
9094
91- #region Protected Methods
95+ #region Protected Methods
9296 protected virtual Task OnTestInitialized ( ) => Task . CompletedTask ;
9397
9498 protected void WriteLine ( string message ) => this . TestOutputHelper . WriteLine ( message ) ;
@@ -152,9 +156,9 @@ protected static TException AssertThrows<TException>(Action action) where TExcep
152156 protected static Task Retry ( Func < Task < bool > > retryMethod , TimeSpan timeout ) => Retry ( retryMethod , x => x , timeout ) ;
153157 protected static Task < TResult > Retry < TResult > ( Func < Task < TResult > > retryMethod , Func < TResult , bool > condition ) => Retry ( retryMethod , condition , TimeSpan . FromMinutes ( 30 ) ) ;
154158 protected static Task < TResult > Retry < TResult > ( Func < Task < TResult > > retryMethod , Func < TResult , bool > condition , TimeSpan timeout ) => retryMethod . Retry ( condition , ( int ) TimeSpan . FromSeconds ( 1 ) . TotalMilliseconds , ( int ) timeout . TotalMilliseconds ) ;
155- #endregion
159+ #endregion
156160
157- #region Private Methods
161+ #region Private Methods
158162 private void OnFirstChanceException ( object sender , FirstChanceExceptionEventArgs e )
159163 {
160164 if ( e . Exception is UnitTestAssertException )
@@ -198,9 +202,9 @@ private static T SafeGetProperty<T>(ref T field, [CallerMemberName] string prope
198202
199203 return field ;
200204 }
201- #endregion
205+ #endregion
202206
203- #region IDisposable Members
207+ #region IDisposable Members
204208 public void Dispose ( )
205209 {
206210 this . Dispose ( true ) ;
@@ -215,6 +219,6 @@ protected virtual void Dispose(bool disposing)
215219 TestResultComposer . Complete ( ) ;
216220 }
217221 }
218- #endregion
222+ #endregion
219223 }
220224}
0 commit comments