示例#1
0
 public UnityTestsExploration(UnitTestAttributeCache unitTestAttributeCache, IProject project,
                              IUnitTestElementsObserver observer, IUnitTestElementIdFactory unitTestElementIdFactory,
                              UnityTestProvider unityTestProvider, IUnitTestElementManager unitTestElementManager, UnityNUnitServiceProvider serviceProvider)
 {
     myUnitTestAttributeCache = unitTestAttributeCache;
     myProject           = project;
     myUnitTestCollector = observer;
     myElementFactory    = new UnityTestElementFactory(unitTestElementIdFactory, unityTestProvider, unitTestElementManager, serviceProvider);
 }
 public UnityTestFileExplorer(IFile file, UnityTestElementFactory factory, UnitTestAttributeCache unitTestAttributeCache,
                              IUnitTestElementsObserver observer, Func <bool> interrupted, IProject project)
 {
     myFile    = file;
     myFactory = factory;
     myUnitTestAttributeCache = unitTestAttributeCache;
     myObserver          = observer;
     myInterrupted       = interrupted;
     myProject           = project;
     myTargetFrameworkId = myProject.GetCurrentTargetFrameworkId();
 }
示例#3
0
        public void ProcessFile(IFile psiFile, IUnitTestElementsObserver observer, Func <bool> interrupted)
        {
            if (!myClrLanguagesKnown.AllLanguages.Any(language => Equals(language, psiFile.Language)))
            {
                return;
            }

            // external sources case.
            var projectFile = psiFile.GetSourceFile().ToProjectFile();

            if (projectFile == null)
            {
                return;
            }

            var factory      = new UnityTestElementFactory(myIdFactory, myUnityTestProvider, myUnitTestElementManager, myServiceProvider);
            var fileExplorer = new UnityTestFileExplorer(psiFile, factory, myUnitTestAttributeCache, observer, interrupted, projectFile.GetProject());

            psiFile.ProcessDescendants(fileExplorer);
        }