Exemplo n.º 1
0
        public static IEnumerable <ProjectFileErrorResult> CheckAssemblyReferencesForErrors(
            this ProjectFile project,
            Func <AssemblyReference, bool> findErrorFunc,
            Func <AssemblyReference, string> errorValue)
        {
            if (project == null)
            {
                throw new ArgumentNullException(nameof(project));
            }

            if (findErrorFunc == null)
            {
                throw new ArgumentNullException(nameof(findErrorFunc));
            }

            if (errorValue == null)
            {
                throw new ArgumentNullException(nameof(errorValue));
            }

            var result       = ProjectFileErrorAnalyzer.AnalyzeErrors(project.AssemblyReferences, findErrorFunc, errorValue).ToList();
            var errorResults = result.Select(item => new ProjectFileErrorResult(project, result));

            return(errorResults);
        }
Exemplo n.º 2
0
        public static IEnumerable <ProjectFileErrorResult> CheckProjectReferencesForErrors(
            this IEnumerable <ProjectFile> projects,
            Func <ProjectReference, bool> findErrorFunc,
            Func <ProjectReference, string> errorValue)
        {
            if (projects == null)
            {
                throw new ArgumentNullException(nameof(projects));
            }

            if (findErrorFunc == null)
            {
                throw new ArgumentNullException(nameof(findErrorFunc));
            }

            if (errorValue == null)
            {
                throw new ArgumentNullException(nameof(errorValue));
            }

            var errorResults = projects.Select(project => new ProjectFileErrorResult(
                                                   project,
                                                   ProjectFileErrorAnalyzer.AnalyzeErrors(project.ProjectReferences, findErrorFunc, errorValue)))
                               .Where(item => item.HasErrors);

            return(errorResults);
        }
Exemplo n.º 3
0
        public static IEnumerable <ProjectFileErrorResult> CheckProjectsForErrors(
            this IEnumerable <ProjectFile> projects,
            Func <ProjectFile, bool> findErrorFunc,
            Func <ProjectFile, string> errorValue)
        {
            if (projects == null)
            {
                throw new ArgumentNullException(nameof(projects));
            }

            if (findErrorFunc == null)
            {
                throw new ArgumentNullException(nameof(findErrorFunc));
            }

            if (errorValue == null)
            {
                throw new ArgumentNullException(nameof(errorValue));
            }

            var errorResults = projects.Select(project =>
            {
                var analyzeResult = ProjectFileErrorAnalyzer.AnalyzeErrors(project, findErrorFunc, errorValue);
                var errors        = analyzeResult == null ? new string[] { } : new[] { analyzeResult };
                return(new ProjectFileErrorResult(project, errors));
            })
                               .Where(item => item.HasErrors);

            return(errorResults);
        }
        internal string AnalyzeErrorsTest01 <T>(
            T source,
            Func <T, bool> filterFunc,
            Func <T, string> errorValue
            )
        {
            string result
                = ProjectFileErrorAnalyzer.AnalyzeErrors <T>(source, filterFunc, errorValue);

            return(result);
            // TODO: add assertions to method ProjectFileErrorAnalyzerTest.AnalyzeErrorsTest01(!!0, Func`2<!!0,Boolean>, Func`2<!!0,String>)
        }
        internal IEnumerable <string> AnalyzeErrorsTest <T>(
            IEnumerable <T> source,
            Func <T, bool> filterFunc,
            Func <T, string> errorValue
            )
        {
            IEnumerable <string> result
                = ProjectFileErrorAnalyzer.AnalyzeErrors <T>(source, filterFunc, errorValue);

            return(result);
            // TODO: add assertions to method ProjectFileErrorAnalyzerTest.AnalyzeErrorsTest(IEnumerable`1<!!0>, Func`2<!!0,Boolean>, Func`2<!!0,String>)
        }