public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
                                                                                  IUnitTestElementManager manager,
                                                                                  PsiModuleManager psiModuleManager,
                                                                                  CacheManager cacheManager,
                                                                                  IProject project,
                                                                                  ContextElement context,
                                                                                  ProjectModelElementEnvoy projectEnvoy,
                                                                                  IClrTypeName declaringTypeName,
                                                                                  string fieldName,
                                                                                  bool isIgnored)
        {
            var id = ContextSpecificationElement.CreateId(context, fieldName);
            var contextSpecification = manager.GetElementById(project, id) as ContextSpecificationElement;

            if (contextSpecification != null)
            {
                contextSpecification.Parent = context;
                contextSpecification.State  = UnitTestElementState.Valid;
                return(contextSpecification);
            }

            return(new ContextSpecificationElement(provider,
                                                   psiModuleManager,
                                                   cacheManager,
                                                   context,
                                                   projectEnvoy,
                                                   declaringTypeName,
                                                   fieldName,
                                                   isIgnored));
        }
Beispiel #2
0
        public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                                                  IUnitTestElementManager manager,
                                                                                  PsiModuleManager psiModuleManager,
                                                                                  CacheManager cacheManager,
#endif
                                                                                  IProject project,
                                                                                  ContextElement context,
                                                                                  ProjectModelElementEnvoy projectEnvoy,
                                                                                  string declaringTypeName,
                                                                                  string fieldName,
                                                                                  ICollection <string> tags,
                                                                                  bool isIgnored)
        {
#if RESHARPER_6
            var id = ContextSpecificationElement.CreateId(context, fieldName);
#if RESHARPER_61
            var contextSpecification = manager.GetElementById(project, id) as ContextSpecificationElement;
#else
            var contextSpecification = provider.UnitTestManager.GetElementById(project, id) as ContextSpecificationElement;
#endif
            if (contextSpecification != null)
            {
                contextSpecification.Parent = context;
                contextSpecification.State  = UnitTestElementState.Valid;
                return(contextSpecification);
            }
#endif

            return(new ContextSpecificationElement(provider,
#if RESHARPER_6
#if RESHARPER_61
                                                   psiModuleManager, cacheManager,
#else
                                                   provider.PsiModuleManager, provider.CacheManager,
#endif
#endif
                                                   context,
                                                   projectEnvoy,
                                                   declaringTypeName,
                                                   fieldName,
                                                   tags,
                                                   isIgnored));
        }
Beispiel #3
0
        public ContextSpecificationElement GetOrCreateContextSpecification(ContextElement context,
                                                                           IClrTypeName declaringTypeName,
                                                                           string fieldName,
                                                                           bool isIgnored)
        {
            var id = ContextSpecificationElement.CreateId(context, fieldName);
            var contextSpecification = _manager.GetElementById(context.GetProject(), id) as ContextSpecificationElement;

            if (contextSpecification != null)
            {
                contextSpecification.Parent = context;
                contextSpecification.State  = UnitTestElementState.Valid;
                return(contextSpecification);
            }

            return(new ContextSpecificationElement(_provider,
                                                   _psiModuleManager,
                                                   _cacheManager,
                                                   new ProjectModelElementEnvoy(context.GetProject()),
                                                   context,
                                                   declaringTypeName,
                                                   fieldName, isIgnored));
        }
Beispiel #4
0
        public ContextSpecificationElement GetOrCreateContextSpecification(ContextElement context,
                                                                           IClrTypeName declaringTypeName,
                                                                           string fieldName,
                                                                           bool isIgnored)
        {
            var id = ContextSpecificationElement.CreateId(_elementIdFactory, _provider, context, fieldName);

            var contextSpecification = this._manager.GetElementById(id) as ContextSpecificationElement;

            if (contextSpecification != null)
            {
                contextSpecification.Parent = context;
                return(contextSpecification);
            }

            return(new ContextSpecificationElement(this._provider,
                                                   id,
                                                   context,
                                                   declaringTypeName.GetPersistent(),
                                                   this._cachingService,
                                                   this._manager,
                                                   fieldName,
                                                   isIgnored));
        }