public SpecificationElement GetOrCreateSpecificationElement(IProject project, SpecificationContainerElement parent, IClrTypeName typeName, string methodName, string skipReason) { var id = string.Format("simple:{0}.{1}", parent.TypeName.FullName, methodName); var element = _unitTestManager.GetElementById(project, id); if (element != null) { element.State = UnitTestElementState.Valid; return element as SpecificationElement; } return new SpecificationElement(_provider, parent, new ProjectModelElementEnvoy(project), _cacheManager, _psiModuleManager, id, typeName.GetPersistent(), methodName, skipReason); }
private void ExploreSpecificationContainer(IProject project, SpecificationContainerElement container, UnitTestElementConsumer consumer, IMetadataTypeInfo metadataTypeInfo) { foreach (var field in metadataTypeInfo.GetFields()) { if (!field.IsPublic) continue; var x = field.Name; var methodElement = _elementFactory.GetOrCreateSpecificationElement(project, container, new ClrTypeName(metadataTypeInfo.FullyQualifiedName), x, string.Empty); consumer(methodElement); } }