private IUnitTestElement ProcessTestClass(IClass testClass)
        {
            var project = psiFile.GetProject();

            if (!conventionCheck.IsValidTestClass(project, testClass))
            {
                return(null);
            }

            var clrTypeName  = testClass.GetClrName();
            var assemblyPath = project.GetOutputFilePath().FullPath;

            return(unitTestElementFactory.GetOrCreateTestClass(project, clrTypeName, assemblyPath));
        }
Ejemplo n.º 2
0
        internal static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, ISolution solution, UnitTestElementFactory unitTestElementFactory)
        {
            var projectId = parent.GetAttribute(AttributeNames.ProjectId);
            var typeName  = parent.GetAttribute(AttributeNames.TypeName);

            var project = (IProject)ProjectUtil.FindProjectElementByPersistentID(solution, projectId);

            if (project == null)
            {
                return(null);
            }
            var assemblyLocation = project.GetOutputFilePath().FullPath;

            return(unitTestElementFactory.GetOrCreateTestClass(project, new ClrTypeName(typeName), assemblyLocation));
        }