@@ -448,21 +448,6 @@ private static string ConflictMessage(bool isConflict, string name, IEnumerable<
448
448
return isConflict ? $ "Identifier '{ name } ' is a conflict but was not identified" : $ "Identifier '{ name } ' was incorrectly found as a conflict";
449
449
}
450
450
451
- private void TestAccessibleDeclarations ( AccessibilityTestsDataObject tdo , string [ ] testSpecificExpectedResults )
452
- {
453
-
454
- PrepareScenarioTestData ( tdo , testSpecificExpectedResults ) ;
455
-
456
- var target = tdo . Parser . AllUserDeclarations . FindTarget ( tdo . QualifiedSelection ) ;
457
- if ( null == target ) { Assert . Inconclusive ( "Unable to find target from QualifiedSelection" ) ; }
458
-
459
- var accessibleNames = new List < string > ( ) ;
460
-
461
- Assert . IsFalse ( accessibleNames . Except ( tdo . ExpectedResults ) . Any ( )
462
- || tdo . ExpectedResults . Except ( accessibleNames ) . Any ( )
463
- , BuildIdentifierListToDisplay ( accessibleNames . Except ( tdo . ExpectedResults ) , tdo . ExpectedResults . Except ( accessibleNames ) ) ) ;
464
- }
465
-
466
451
private IEnumerable < Declaration > TestConflictingDeclaration ( AccessibilityTestsDataObject tdo , string name )
467
452
{
468
453
@@ -482,16 +467,6 @@ private void AcquireTarget(AccessibilityTestsDataObject tdo, out Declaration tar
482
467
}
483
468
484
469
485
- private void PrepareScenarioTestData ( AccessibilityTestsDataObject tdo , string [ ] testSpecificExpectedResults )
486
- {
487
- SetExpectedResults ( tdo , testSpecificExpectedResults ) ;
488
-
489
- tdo . VBE = BuildProject ( tdo . ProjectName , tdo . Components ) ;
490
- tdo . Parser = MockParser . CreateAndParse ( tdo . VBE ) ;
491
-
492
- CreateQualifiedSelectionForTestCase ( tdo ) ;
493
- }
494
-
495
470
private void PrepareScenarioTestData ( AccessibilityTestsDataObject tdo , string name )
496
471
{
497
472
tdo . VBE = BuildProject ( tdo . ProjectName , tdo . Components ) ;
@@ -502,74 +477,6 @@ private void PrepareScenarioTestData(AccessibilityTestsDataObject tdo, string na
502
477
tdo . QualifiedSelection = new QualifiedSelection ( new QualifiedModuleName ( moduleParent ) , tdo . Target ) ;
503
478
}
504
479
505
- private void SetExpectedResults ( AccessibilityTestsDataObject tdo , string [ ] testSpecificExpectedResults )
506
- {
507
- tdo . ExpectedResults = new List < string > ( ) ;
508
- tdo . ExpectedResults . AddRange ( testSpecificExpectedResults ) ;
509
-
510
- //Add module name(s) and project name
511
- tdo . ExpectedResults . Add ( tdo . SelectionTarget ) ;
512
- tdo . Components . ForEach ( c => tdo . ExpectedResults . Add ( c . Name ) ) ;
513
- tdo . ExpectedResults . Add ( tdo . ProjectName ) ;
514
- }
515
-
516
- private string BuildIdentifierListToDisplay ( IEnumerable < string > extraIdentifiers , IEnumerable < string > missedIdentifiers )
517
- {
518
- var extraNamesPreface = "Returned unexpected identifier(s): " ;
519
- var missedNamesPreface = "Did not return expected identifier(s): " ;
520
- string extraResults = string . Empty ;
521
- string missingResults = string . Empty ;
522
- if ( extraIdentifiers . Any ( ) )
523
- {
524
- extraResults = extraNamesPreface + GetListOfNames ( extraIdentifiers ) ;
525
- }
526
- if ( missedIdentifiers . Any ( ) )
527
- {
528
- missingResults = missedNamesPreface + GetListOfNames ( missedIdentifiers ) ;
529
- }
530
-
531
- return "\r \n " + extraResults + "\r \n " + missingResults ;
532
- }
533
-
534
- private string GetListOfNames ( IEnumerable < string > identifiers )
535
- {
536
- if ( ! identifiers . Any ( ) ) { return "" ; }
537
-
538
- string result = string . Empty ;
539
- string postPend = "', " ;
540
- foreach ( var identifier in identifiers )
541
- {
542
- result = result + "'" + identifier + postPend ;
543
- }
544
- return result . Remove ( result . Length - postPend . Length + 1 ) ;
545
- }
546
-
547
- private void CreateQualifiedSelectionForTestCase ( AccessibilityTestsDataObject tdo )
548
- {
549
- var component = RetrieveComponent ( tdo , tdo . SelectionModuleName ) ;
550
- var moduleContent = component . CodeModule . GetLines ( 1 , component . CodeModule . CountOfLines ) ;
551
-
552
- var splitToken = new string [ ] { "\r \n " } ;
553
-
554
- var lines = moduleContent . Split ( splitToken , System . StringSplitOptions . None ) ;
555
- int lineOfInterestNumber = 0 ;
556
- string lineOfInterestContent = string . Empty ;
557
- for ( int idx = 0 ; idx < lines . Count ( ) && lineOfInterestNumber < 1 ; idx ++ )
558
- {
559
- if ( lines [ idx ] . Contains ( tdo . SelectionLineIdentifier ) )
560
- {
561
- lineOfInterestNumber = idx + 1 ;
562
- lineOfInterestContent = lines [ idx ] ;
563
- }
564
- }
565
- Assert . IsTrue ( lineOfInterestNumber > 0 , "Unable to find target '" + tdo . SelectionTarget + "' in " + tdo . SelectionModuleName + " content." ) ;
566
- var column = lineOfInterestContent . IndexOf ( tdo . SelectionLineIdentifier ) ;
567
- column = column + tdo . SelectionLineIdentifier . IndexOf ( tdo . SelectionTarget ) + 1 ;
568
-
569
- var moduleParent = component . CodeModule . Parent ;
570
- tdo . QualifiedSelection = new QualifiedSelection ( new QualifiedModuleName ( moduleParent ) , new Selection ( lineOfInterestNumber , column , lineOfInterestNumber , column ) ) ;
571
- }
572
-
573
480
private void AddTestComponent ( AccessibilityTestsDataObject tdo , string moduleIdentifier , ComponentType componentType )
574
481
{
575
482
if ( null == tdo . Components )
@@ -605,13 +512,6 @@ private IVBComponent RetrieveComponent(AccessibilityTestsDataObject tdo, string
605
512
return vbProject . VBComponents . Where ( item => item . Name == componentName ) . SingleOrDefault ( ) ;
606
513
}
607
514
608
- private void AddTestSelectionCriteria ( AccessibilityTestsDataObject tdo , string moduleName , string selectionTarget , string selectionLineIdentifier )
609
- {
610
- tdo . SelectionModuleName = moduleName ;
611
- tdo . SelectionTarget = selectionTarget ;
612
- tdo . SelectionLineIdentifier = selectionLineIdentifier ;
613
- }
614
-
615
515
internal class TestComponentSpecification
616
516
{
617
517
public TestComponentSpecification ( string componentName , string componentContent , ComponentType componentType )
0 commit comments