@@ -315,25 +315,55 @@ public void FindsSymbolsInFile()
315315 public void FindsSymbolsInPesterFile ( )
316316 {
317317 List < PesterSymbolReference > symbolsResult = FindSymbolsInFile ( FindSymbolsInPesterFile . SourceDetails ) . OfType < PesterSymbolReference > ( ) . ToList ( ) ;
318- Assert . Equal ( 5 , symbolsResult . Count ( r => r . SymbolType == SymbolType . Function ) ) ;
318+ Assert . Equal ( 12 , symbolsResult . Count ( r => r . SymbolType == SymbolType . Function ) ) ;
319319
320320 Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . Describe ) ) ;
321321 SymbolReference firstDescribeSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . Describe ) ;
322- Assert . Equal ( "Describe \" A dummy test \" " , firstDescribeSymbol . SymbolName ) ;
323- Assert . Equal ( 1 , firstDescribeSymbol . ScriptRegion . StartLineNumber ) ;
322+ Assert . Equal ( "Describe \" Testing Pester symbols \" " , firstDescribeSymbol . SymbolName ) ;
323+ Assert . Equal ( 9 , firstDescribeSymbol . ScriptRegion . StartLineNumber ) ;
324324 Assert . Equal ( 1 , firstDescribeSymbol . ScriptRegion . StartColumnNumber ) ;
325325
326326 Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . Context ) ) ;
327327 SymbolReference firstContextSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . Context ) ;
328- Assert . Equal ( "Context \" When a pester file is given\" " , firstContextSymbol . SymbolName ) ;
329- Assert . Equal ( 2 , firstContextSymbol . ScriptRegion . StartLineNumber ) ;
328+ Assert . Equal ( "Context \" When a Pester file is given\" " , firstContextSymbol . SymbolName ) ;
329+ Assert . Equal ( 10 , firstContextSymbol . ScriptRegion . StartLineNumber ) ;
330330 Assert . Equal ( 5 , firstContextSymbol . ScriptRegion . StartColumnNumber ) ;
331331
332- Assert . Equal ( 3 , symbolsResult . Count ( r => r . Command == PesterCommandType . It ) ) ;
332+ Assert . Equal ( 4 , symbolsResult . Count ( r => r . Command == PesterCommandType . It ) ) ;
333333 SymbolReference lastItSymbol = symbolsResult . Last ( r => r . Command == PesterCommandType . It ) ;
334- Assert . Equal ( "It \" Should return describe symbols\" " , lastItSymbol . SymbolName ) ;
335- Assert . Equal ( 11 , lastItSymbol . ScriptRegion . StartLineNumber ) ;
334+ Assert . Equal ( "It \" Should return setup and teardown symbols\" " , lastItSymbol . SymbolName ) ;
335+ Assert . Equal ( 31 , lastItSymbol . ScriptRegion . StartLineNumber ) ;
336336 Assert . Equal ( 9 , lastItSymbol . ScriptRegion . StartColumnNumber ) ;
337+
338+ Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . BeforeDiscovery ) ) ;
339+ SymbolReference firstBeforeDisocverySymbol = symbolsResult . First ( r => r . Command == PesterCommandType . BeforeDiscovery ) ;
340+ Assert . Equal ( "BeforeDiscovery" , firstBeforeDisocverySymbol . SymbolName ) ;
341+ Assert . Equal ( 1 , firstBeforeDisocverySymbol . ScriptRegion . StartLineNumber ) ;
342+ Assert . Equal ( 1 , firstBeforeDisocverySymbol . ScriptRegion . StartColumnNumber ) ;
343+
344+ Assert . Equal ( 2 , symbolsResult . Count ( r => r . Command == PesterCommandType . BeforeAll ) ) ;
345+ SymbolReference lastBeforeAllSymbol = symbolsResult . Last ( r => r . Command == PesterCommandType . BeforeAll ) ;
346+ Assert . Equal ( "BeforeAll" , lastBeforeAllSymbol . SymbolName ) ;
347+ Assert . Equal ( 11 , lastBeforeAllSymbol . ScriptRegion . StartLineNumber ) ;
348+ Assert . Equal ( 9 , lastBeforeAllSymbol . ScriptRegion . StartColumnNumber ) ;
349+
350+ Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . BeforeEach ) ) ;
351+ SymbolReference firstBeforeEachSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . BeforeEach ) ;
352+ Assert . Equal ( "BeforeEach" , firstBeforeEachSymbol . SymbolName ) ;
353+ Assert . Equal ( 15 , firstBeforeEachSymbol . ScriptRegion . StartLineNumber ) ;
354+ Assert . Equal ( 9 , firstBeforeEachSymbol . ScriptRegion . StartColumnNumber ) ;
355+
356+ Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . AfterEach ) ) ;
357+ SymbolReference firstAfterEachSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . AfterEach ) ;
358+ Assert . Equal ( "AfterEach" , firstAfterEachSymbol . SymbolName ) ;
359+ Assert . Equal ( 35 , firstAfterEachSymbol . ScriptRegion . StartLineNumber ) ;
360+ Assert . Equal ( 9 , firstAfterEachSymbol . ScriptRegion . StartColumnNumber ) ;
361+
362+ Assert . Equal ( 1 , symbolsResult . Count ( r => r . Command == PesterCommandType . AfterAll ) ) ;
363+ SymbolReference firstAfterAllSymbol = symbolsResult . First ( r => r . Command == PesterCommandType . AfterAll ) ;
364+ Assert . Equal ( "AfterAll" , firstAfterAllSymbol . SymbolName ) ;
365+ Assert . Equal ( 40 , firstAfterAllSymbol . ScriptRegion . StartLineNumber ) ;
366+ Assert . Equal ( 5 , firstAfterAllSymbol . ScriptRegion . StartColumnNumber ) ;
337367 }
338368
339369 [ Fact ]
0 commit comments