File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
src/TestStack.BDDfy/Scanners/ScenarioScanners Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Diagnostics ;
1+ using System . Collections . Generic ;
42using System . Linq ;
53using TestStack . BDDfy . Configuration ;
64
@@ -38,26 +36,18 @@ private List<Step> CloneSteps(IEnumerable<Step> steps)
3836 private static string GetTitleFromMethodNameInStackTrace ( object testObject )
3937 {
4038 // ReSharper disable once JoinDeclarationAndInitializer
41- StackTrace trace ;
4239#if STACKTRACE
43- trace = new StackTrace ( ) ;
44- #else
45- try
46- {
47- throw new Exception ( ) ;
48- }
49- catch ( Exception e )
50- {
51- trace = new StackTrace ( e , false ) ;
52- }
53- #endif
40+ var trace = new System . Diagnostics . StackTrace ( ) ;
5441 var frames = trace . GetFrames ( ) ;
5542
5643 var initiatingFrame = frames ? . LastOrDefault ( s => s . GetMethod ( ) . DeclaringType == testObject . GetType ( ) ) ;
5744 if ( initiatingFrame == null )
5845 return null ;
5946
6047 return Configurator . Scanners . Humanize ( initiatingFrame . GetMethod ( ) . Name ) ;
48+ #else
49+ return null ;
50+ #endif
6151 }
6252 }
6353}
You can’t perform that action at this time.
0 commit comments