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));
        }
Exemple #2
0
        public static BehaviorElement GetOrCreateBehavior(MSpecUnitTestProvider provider,
                                                          IUnitTestElementManager manager,
                                                          PsiModuleManager psiModuleManager,
                                                          CacheManager cacheManager,
                                                          IProject project,
                                                          ProjectModelElementEnvoy projectEnvoy,
                                                          ContextElement context,
                                                          IClrTypeName declaringTypeName,
                                                          string fieldName,
                                                          bool isIgnored,
                                                          string fieldType)
        {
            var id       = BehaviorElement.CreateId(context, fieldType, fieldName);
            var behavior = manager.GetElementById(project, id) as BehaviorElement;

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

            return(new BehaviorElement(provider,
                                       psiModuleManager,
                                       cacheManager,
                                       context,
                                       projectEnvoy,
                                       declaringTypeName,
                                       fieldName,
                                       isIgnored,
                                       fieldType));
        }
        public ContextElement GetOrCreateContext(string assemblyPath,
                                                 IProject project,
                                                 IClrTypeName typeName,
                                                 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,
                                      new ProjectModelElementEnvoy(project),
                                      typeName,
                                      assemblyPath,
                                      subject,
                                      tags,
                                      isIgnored));
        }
        public BehaviorElement GetOrCreateBehavior(ContextElement context,
                                                   IClrTypeName declaringTypeName,
                                                   string fieldName,
                                                   bool isIgnored,
                                                   string fieldType)
        {
            var id       = BehaviorElement.CreateId(context, fieldType, fieldName);
            var behavior = _manager.GetElementById(context.GetProject(), id) as BehaviorElement;

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

            return(new BehaviorElement(_provider,
                                       _psiModuleManager,
                                       _cacheManager,
                                       context,
                                       new ProjectModelElementEnvoy(context.GetProject()),
                                       declaringTypeName,
                                       fieldName,
                                       isIgnored,
                                       fieldType));
        }
        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));
        }
Exemple #6
0
        public static BehaviorSpecificationElement GetOrCreateBehaviorSpecification(MSpecUnitTestProvider provider,
                                                                                    IUnitTestElementManager manager,
                                                                                    PsiModuleManager psiModuleManager,
                                                                                    CacheManager cacheManager,
                                                                                    IProject project,
                                                                                    BehaviorElement behavior,
                                                                                    ProjectModelElementEnvoy projectEnvoy,
                                                                                    IClrTypeName declaringTypeName,
                                                                                    string fieldName,
                                                                                    bool isIgnored)
        {
            var id = BehaviorSpecificationElement.CreateId(behavior, fieldName);
            var behaviorSpecification = manager.GetElementById(project, id) as BehaviorSpecificationElement;

            if (behaviorSpecification != null)
            {
                behaviorSpecification.Parent = behavior;
                behaviorSpecification.State  = UnitTestElementState.Valid;
                return(behaviorSpecification);
            }

            return(new BehaviorSpecificationElement(provider,
                                                    psiModuleManager,
                                                    cacheManager,
                                                    behavior,
                                                    projectEnvoy,
                                                    declaringTypeName,
                                                    fieldName,
                                                    isIgnored));
        }
Exemple #7
0
        public JasmineSpecificationElement GetOrCreateSpecification(string specificationName, IProject project,
                                                                    ProjectModelElementEnvoy projectFileEnvoy, string filename, TextRange textRange, IList <string> referencedFiles,
                                                                    IUnitTestElement suite)
        {
            var id          = string.Format("{0}:{1}", (suite != null) ? suite.Id : _provider.TestProvider.ID, specificationName);
            var elementById = _unitTestElementManager.GetElementById(project, id) as JasmineSpecificationElement;

            if (elementById != null)
            {
                elementById.Parent          = suite;
                elementById.ReferencedFiles = referencedFiles;
                elementById.TextRange       = textRange;
                elementById.State           = UnitTestElementState.Valid;
                return(elementById);
            }
            return(new JasmineSpecificationElement(_provider, specificationName, projectFileEnvoy, textRange, referencedFiles)
            {
                Parent = suite
            });
        }
Exemple #8
0
        private T GetElementById <T>(UnitTestElementId id)
            where T : class, IUnitTestElement
        {
            IUnitTestElement element;

            if (myElements.TryGetValue(id, out element))
            {
                return(element as T);
            }

            return(myElementManager.GetElementById(id) as T);
        }
Exemple #9
0
        private IUnitTestElement GetOrCreateAndUpdateElement(
            ITestEntity testEntity,
            Func <ITestIdentity, ITestElement> factory)
        {
            var elementId = _unitTestElementIdFactory.Create(
                _testProvider.ID,
                testEntity.Project.GetPersistentID(),
                // TODO: TargetFrameworkId
                TargetFrameworkId.Default,
                testEntity.Identity.Absolute);
            var identity = new TestIdentity(elementId, testEntity.Identity);
            var element  = _unitTestElementManager.GetElementById(identity.ElementId) as ITestElement ?? factory(identity);

            element.Update(testEntity.Text, explicitReason: null, categories: testEntity.Categories.Select(x => _unitTestElementCategoryFactory.Create(x)));

            return(element);
        }
        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));
        }
        public static BehaviorElement GetOrCreateBehavior(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                          IUnitTestElementManager manager,
                                                          PsiModuleManager psiModuleManager,
                                                          CacheManager cacheManager,
#endif
                                                          IProject project,
                                                          ProjectModelElementEnvoy projectEnvoy,
                                                          ContextElement context,
                                                          string declaringTypeName,
                                                          string fieldName,
                                                          bool isIgnored,
                                                          string fullyQualifiedTypeName)
        {
#if RESHARPER_6
            var id = BehaviorElement.CreateId(context, fieldName);
#if RESHARPER_61
            var behavior = manager.GetElementById(project, id) as BehaviorElement;
#else
            var behavior = provider.UnitTestManager.GetElementById(project, id) as BehaviorElement;
#endif
            if (behavior != null)
            {
                behavior.Parent = context;
                behavior.State  = UnitTestElementState.Valid;
                return(behavior);
            }
#endif

            return(new BehaviorElement(provider,
#if RESHARPER_6
#if RESHARPER_61
                                       psiModuleManager, cacheManager,
#else
                                       provider.PsiModuleManager, provider.CacheManager,
#endif
#endif
                                       context,
                                       projectEnvoy,
                                       declaringTypeName,
                                       fieldName,
                                       isIgnored,
                                       fullyQualifiedTypeName));
        }
Exemple #12
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));
        }
        public static BehaviorSpecificationElement GetOrCreateBehaviorSpecification(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                                                    IUnitTestElementManager manager,
                                                                                    PsiModuleManager psiModuleManager,
                                                                                    CacheManager cacheManager,
#endif
                                                                                    IProject project,
                                                                                    BehaviorElement behavior,
                                                                                    ProjectModelElementEnvoy projectEnvoy,
                                                                                    string declaringTypeName,
                                                                                    string fieldName,
                                                                                    bool isIgnored)
        {
#if RESHARPER_6
            var id = BehaviorSpecificationElement.CreateId(behavior, fieldName);
#if RESHARPER_61
            var behaviorSpecification = manager.GetElementById(project, id) as BehaviorSpecificationElement;
#else
            var behaviorSpecification = provider.UnitTestManager.GetElementById(project, id) as BehaviorSpecificationElement;
#endif
            if (behaviorSpecification != null)
            {
                behaviorSpecification.Parent = behavior;
                behaviorSpecification.State  = UnitTestElementState.Valid;
                return(behaviorSpecification);
            }
#endif

            return(new BehaviorSpecificationElement(provider,
#if RESHARPER_6
#if RESHARPER_61
                                                    psiModuleManager, cacheManager,
#else
                                                    provider.PsiModuleManager, provider.CacheManager,
#endif
#endif
                                                    behavior,
                                                    projectEnvoy,
                                                    declaringTypeName,
                                                    fieldName,
                                                    isIgnored));
        }
Exemple #14
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));
        }
        public BehaviorSpecificationElement GetOrCreateBehaviorSpecification(BehaviorElement behavior,
                                                                             IClrTypeName declaringTypeName,
                                                                             string fieldName,
                                                                             bool isIgnored)
        {
            var id = BehaviorSpecificationElement.CreateId(behavior, fieldName);
            var behaviorSpecification = _manager.GetElementById(behavior.GetProject(), id) as BehaviorSpecificationElement;

            if (behaviorSpecification != null)
            {
                behaviorSpecification.Parent = behavior;
                behaviorSpecification.State  = UnitTestElementState.Valid;
                return(behaviorSpecification);
            }

            return(new BehaviorSpecificationElement(_provider,
                                                    _psiModuleManager,
                                                    _cacheManager,
                                                    new ProjectModelElementEnvoy(behavior.GetProject()),
                                                    behavior,
                                                    declaringTypeName,
                                                    fieldName,
                                                    isIgnored));
        }
    public static BehaviorElement GetOrCreateBehavior(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                      IUnitTestElementManager manager,
                                                      PsiModuleManager psiModuleManager,
                                                      CacheManager cacheManager,
#endif
                                                      IProject project,
                                                      ProjectModelElementEnvoy projectEnvoy,
                                                      ContextElement context,
                                                      IClrTypeName declaringTypeName,
                                                      string fieldName,
                                                      bool isIgnored,
                                                      string fullyQualifiedTypeName)
    {
      var id = BehaviorElement.CreateId(context, fieldName);
#if RESHARPER_61
      var behavior = manager.GetElementById(project, id) as BehaviorElement;
#else
      var behavior = provider.UnitTestManager.GetElementById(project, id) as BehaviorElement;
#endif
      if (behavior != null)
      {
        behavior.Parent = context;
        behavior.State = UnitTestElementState.Valid;
        return behavior;
      }

      return new BehaviorElement(provider,
#if RESHARPER_61
                                 psiModuleManager, cacheManager, 
#else
                                 provider.PsiModuleManager, provider.CacheManager,
#endif
                                 context,
                                 projectEnvoy,
                                 declaringTypeName,
                                 fieldName,
                                 isIgnored,
                                 fullyQualifiedTypeName);
    }
 public static ITestElement GetElementByIdentity(this IUnitTestElementManager unitTestElementManager, ITestIdentity testIdentity)
 {
     return(unitTestElementManager.GetElementById(testIdentity.ElementId) as ITestElement);
 }
    public static BehaviorSpecificationElement GetOrCreateBehaviorSpecification(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                                                IUnitTestElementManager manager,
                                                                                PsiModuleManager psiModuleManager,
                                                                                CacheManager cacheManager,
#endif
                                                                                IProject project,
                                                                                BehaviorElement behavior,
                                                                                ProjectModelElementEnvoy projectEnvoy,
                                                                                string declaringTypeName,
                                                                                string fieldName,
                                                                                bool isIgnored)
    {
#if RESHARPER_6
      var id = BehaviorSpecificationElement.CreateId(behavior.Id, fieldName);
#if RESHARPER_61
      var behaviorSpecification = manager.GetElementById(project, id) as BehaviorSpecificationElement;
#else
      var behaviorSpecification = provider.UnitTestManager.GetElementById(project, id) as BehaviorSpecificationElement;
#endif
      if (behaviorSpecification != null)
      {
        behaviorSpecification.Parent = behavior;
        behaviorSpecification.State = UnitTestElementState.Valid;
        return behaviorSpecification;
      }
#endif

      return new BehaviorSpecificationElement(provider,
#if RESHARPER_6
#if RESHARPER_61
                                 psiModuleManager, cacheManager, 
#else
                                 provider.PsiModuleManager, provider.CacheManager,
#endif
#endif
                                              behavior,
                                              projectEnvoy,
                                              declaringTypeName,
                                              fieldName,
                                              isIgnored);
    }
    public static ContextElement GetOrCreateContextElement(TestProvider provider,
#if RESHARPER_61
                                                           IUnitTestElementManager manager,
                                                           PsiModuleManager psiModuleManager,
                                                           CacheManager cacheManager,
#endif
                                                           IProject project,
                                                           ProjectModelElementEnvoy projectEnvoy,
                                                           string typeName,
                                                           string assemblyLocation)
    {
#if RESHARPER_6
      var id = ContextElement.CreateId(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,
								false);
    }
    public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
#if RESHARPER_61
                                                                              IUnitTestElementManager manager,
                                                                              PsiModuleManager psiModuleManager,
                                                                              CacheManager cacheManager,
#endif
                                                                              IProject project,
                                                                              ContextElement context,
                                                                              ProjectModelElementEnvoy projectEnvoy,
                                                                              IClrTypeName declaringTypeName,
                                                                              string fieldName,
                                                                              ICollection<string> tags,
                                                                              bool isIgnored)
    {
      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;
      }

      return new ContextSpecificationElement(provider,
#if RESHARPER_61
                                 psiModuleManager, cacheManager, 
#else
                                 provider.PsiModuleManager, provider.CacheManager,
#endif
                                             context,
                                             projectEnvoy,
                                             declaringTypeName,
                                             fieldName,
                                             tags,
                                             isIgnored);
    }
 public static IUnitTestElementEx GetElementByIdentity(this IUnitTestElementManager unitTestElementManager, IUnitTestIdentity unitTestIdentity)
 {
     return(unitTestElementManager.GetElementById(unitTestIdentity.GetProject(), unitTestIdentity.Absolute) as IUnitTestElementEx);
 }
    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 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)
    {
      var id = ContextElement.CreateId(subject, typeName, tags);
#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;
      }

      return new ContextElement(provider,
#if RESHARPER_61
                                psiModuleManager,
                                cacheManager,
#else
                                provider.PsiModuleManager,
                                provider.CacheManager,
#endif                
                                projectEnvoy,
                                typeName,
                                assemblyLocation,
                                subject,
                                tags,
                                isIgnored);
    }
    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);
    }
    public static BehaviorSpecificationElement GetOrCreateBehaviorSpecification(MSpecUnitTestProvider provider,
                                                                                IUnitTestElementManager manager,
                                                                                PsiModuleManager psiModuleManager,
                                                                                CacheManager cacheManager,
                                                                                IProject project,
                                                                                BehaviorElement behavior,
                                                                                ProjectModelElementEnvoy projectEnvoy,
                                                                                IClrTypeName declaringTypeName,
                                                                                string fieldName,
                                                                                bool isIgnored)
    {
      var id = BehaviorSpecificationElement.CreateId(behavior, fieldName);
      var behaviorSpecification = manager.GetElementById(project, id) as BehaviorSpecificationElement;
      if (behaviorSpecification != null)
      {
        behaviorSpecification.Parent = behavior;
        behaviorSpecification.State = UnitTestElementState.Valid;
        return behaviorSpecification;
      }

      return new BehaviorSpecificationElement(provider,
                                              psiModuleManager,
                                              cacheManager,
                                              behavior,
                                              projectEnvoy,
                                              declaringTypeName,
                                              fieldName,
                                              isIgnored);
    }