public static ContextElement GetOrCreateContext(MSpecUnitTestProvider provider,
                                                        IUnitTestElementManager manager,
                                                        PsiModuleManager psiModuleManager,
                                                        CacheManager cacheManager,
                                                        IProject project,
                                                        ProjectModelElementEnvoy projectEnvoy,
                                                        IClrTypeName typeName,
                                                        string assemblyLocation,
                                                        string subject,
                                                        ICollection <string> tags,
                                                        bool isIgnored)
        {
            var id             = ContextElement.CreateId(subject, typeName.FullName, tags);
            var contextElement = manager.GetElementById(project, id) as ContextElement;

            if (contextElement != null)
            {
                contextElement.State = UnitTestElementState.Valid;
                return(contextElement);
            }

            return(new ContextElement(provider,
                                      psiModuleManager,
                                      cacheManager,
                                      projectEnvoy,
                                      typeName,
                                      assemblyLocation,
                                      subject,
                                      tags,
                                      isIgnored));
        }
        public ContextElement GetOrCreateContext(string assemblyPath,
                                                 IProject project,
                                                 IClrTypeName typeName,
                                                 string subject,
                                                 ICollection <string> tags,
                                                 bool isIgnored)
        {
            var id             = ContextElement.CreateId(_provider, project, subject, typeName.FullName, tags);
            var contextElement = this._manager.GetElementById(id) as ContextElement;

            if (contextElement != null)
            {
                contextElement.State            = UnitTestElementState.Valid;
                contextElement.AssemblyLocation = assemblyPath;
                return(contextElement);
            }

            return(new ContextElement(this._provider,
                                      this._psiModuleManager,
                                      this._cacheManager,
                                      new ProjectModelElementEnvoy(project),
                                      typeName,
                                      assemblyPath,
                                      subject,
                                      tags,
                                      isIgnored,
                                      _categoryFactory));
        }
        public ContextElement GetOrCreateContext(string assemblyPath,
                                                 IProject project,
                                                 IClrTypeName contextTypeName,
                                                 string subject,
                                                 ICollection <string> tags,
                                                 bool isIgnored)
        {
            UnitTestElementId id = ContextElement.CreateId(_elementIdFactory, _provider, project, subject, contextTypeName.FullName, tags);

            var contextElement = this._manager.GetElementById(id) as ContextElement;

            if (contextElement != null)
            {
                contextElement.AssemblyLocation = assemblyPath;
                return(contextElement);
            }

            return(new ContextElement(this._provider,
                                      id,
                                      contextTypeName.GetPersistent(),
                                      this._cachingService,
                                      this._manager,
                                      assemblyPath,
                                      subject,
                                      tags,
                                      isIgnored,
                                      _categoryFactory));
        }
        public static ContextElement GetOrCreateContextElement(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                               IUnitTestElementManager manager,
                                                               PsiModuleManager psiModuleManager,
                                                               CacheManager cacheManager,
#endif
                                                               IProject project,
                                                               ProjectModelElementEnvoy projectEnvoy,
                                                               string typeName,
                                                               string assemblyLocation,
                                                               string subject,
                                                               ICollection <string> tags,
                                                               bool isIgnored)
        {
#if RESHARPER_6
            var id = ContextElement.CreateId(subject, typeName);
#if RESHARPER_61
            var contextElement = manager.GetElementById(project, id) as ContextElement;
#else
            var contextElement = provider.UnitTestManager.GetElementById(project, id) as ContextElement;
#endif
            if (contextElement != null)
            {
                contextElement.State = UnitTestElementState.Valid;
                return(contextElement);
            }
#endif

            return(new ContextElement(provider,
#if RESHARPER_6
#if RESHARPER_61
                                      psiModuleManager,
                                      cacheManager,
#else
                                      provider.PsiModuleManager,
                                      provider.CacheManager,
#endif
#endif
                                      projectEnvoy,
                                      typeName,
                                      assemblyLocation,
                                      subject,
                                      tags,
                                      isIgnored));
        }