public AssemblyExplorer(TestProvider provider,
#if RESHARPER_61
                            IUnitTestElementManager manager,
                            PsiModuleManager psiModuleManager,
                            CacheManager cacheManager,
#endif
                            IMetadataAssembly assembly,
                            IProject project,
                            UnitTestElementConsumer consumer)
    {
      _assembly = assembly;
      _consumer = consumer;

      using (ReadLockCookie.Create())
      {
        var projectEnvoy = new ProjectModelElementEnvoy(project);

        var cache = new ContextCache();
#if RESHARPER_61
        _contextFactory = new ContextFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, _assembly.Location.FullPath, cache);
        _contextSpecificationFactory = new ContextSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
        _behaviorFactory = new BehaviorFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
        _behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy);
#else
#if RESHARPER_6
        _contextFactory = new ContextFactory(provider, project, projectEnvoy, _assembly.Location.FullPath, cache);
#else
        _contextFactory = new ContextFactory(provider, project, projectEnvoy, _assembly.Location, cache);
#endif
        _contextSpecificationFactory = new ContextSpecificationFactory(provider, project, projectEnvoy, cache);
#endif
      }
    }
    public ContextSpecificationFactory(TestProvider provider, IProject project, ProjectModelElementEnvoy projectEnvoy, ContextCache cache)
    {
#endif
      _provider = provider;
      _cache = cache;
      _project = project;
      _projectEnvoy = projectEnvoy;
    }
Exemplo n.º 3
0
    public ContextFactory(TestProvider provider, IProject project, ProjectModelElementEnvoy projectEnvoy, string assemblyPath, ContextCache cache)
    {
#endif
      _provider = provider;
      _cache = cache;
      _project = project;
      _projectEnvoy = projectEnvoy;
      _assemblyPath = assemblyPath;
    }
Exemplo n.º 4
0
    public FileExplorer(TestProvider provider,
#if RESHARPER_61
                        IUnitTestElementManager manager,
                        PsiModuleManager psiModuleManager,
                        CacheManager cacheManager,
#endif
                        UnitTestElementLocationConsumer consumer,
                        IFile file,
                        CheckForInterrupt interrupted)
    {
      if (file == null)
      {
        throw new ArgumentNullException("file");
      }

      if (provider == null)
      {
        throw new ArgumentNullException("provider");
      }

      _consumer = consumer;
      _file = file;
      _interrupted = interrupted;

#if RESHARPER_6
      IProject project =  PsiSourceFileExtensions.ToProjectFile(file.GetSourceFile()).GetProject();
#else
      resharper::JetBrains.ProjectModel.IProject project = file.ProjectFile.GetProject();
#endif
      var projectEnvoy = new ProjectModelElementEnvoy(project);
      string assemblyPath = UnitTestManager.GetOutputAssemblyPath(project).FullPath;

      var cache = new ContextCache();


#if RESHARPER_61
      var contextFactory = new ContextFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, assemblyPath, cache);
      var contextSpecificationFactory = new ContextSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
      var behaviorFactory = new BehaviorFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
      var behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy);
#else
      var contextFactory = new ContextFactory(provider, project, projectEnvoy, assemblyPath, cache);
      var contextSpecificationFactory = new ContextSpecificationFactory(provider, project, projectEnvoy, cache);
#endif

      _elementHandlers = new List<IElementHandler>
                         {
                           new ContextElementHandler(contextFactory),
                           new ContextSpecificationElementHandler(contextSpecificationFactory),
                         };
    }
 public ContextSpecificationFactory(TestProvider provider, IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager, IProject project, ProjectModelElementEnvoy projectEnvoy, ContextCache cache)
 {
   _manager = manager;
   _psiModuleManager = psiModuleManager;
   _cacheManager = cacheManager;
Exemplo n.º 6
0
 public ContextFactory(TestProvider provider, IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager, IProject project, ProjectModelElementEnvoy projectEnvoy, string assemblyPath, ContextCache cache)
 {
   _manager = manager;
   _psiModuleManager = psiModuleManager;
   _cacheManager = cacheManager;