Beispiel #1
0
        private static IEnumerable <IProjectFile> GetNetCoreJsonConfigFiles(IProjectFolder project)
        {
            var additionalConfigurationFiles = project.GetSolution().GetAdditionalConfigurationFiles();

            return(project.GetAllProjectFiles(
                       file => file.LanguageType.Is <JsonProjectFileType>() &&
                       (file.Name.Equals(FileNames.NetCoreAppSettingsJson, StringComparison.OrdinalIgnoreCase) ||
                        additionalConfigurationFiles.Contains(file.GetPersistentID()))));
        }
        private static IProjectFile FindTestFileInProject(IProjectFolder testProject, string fileName)
        {
            if (fileName.Contains('.'))
            {
                fileName = fileName.Split('.').First();
            }
            var projectFiles = testProject.GetAllProjectFiles();

            return(projectFiles.FirstOrDefault(file => file.Name.Contains(fileName)));
        }
Beispiel #3
0
        private static IEnumerable <IProjectFile> GetXmlConfigFiles(IProjectFolder project)
        {
            var additionalConfigurationFiles = project.GetSolution().GetAdditionalConfigurationFiles();

            var xmlConfigFiles = new HashSet <IProjectFile>(
                project.GetAllProjectFiles(
                    file => file.LanguageType.Is <XmlProjectFileType>() &&
                    (file.Name.Equals(FileNames.WebConfig, StringComparison.OrdinalIgnoreCase) ||
                     file.Name.Equals(FileNames.AppConfig, StringComparison.OrdinalIgnoreCase) ||
                     additionalConfigurationFiles.Contains(file.GetPersistentID()))));

            UnionWithDependentFiles(xmlConfigFiles);

            return(xmlConfigFiles);
        }