/// <summary>
        /// Asserts the exported types with missing comments.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <param name="excludeTypes">The exclude types.</param>
        public static void AssertExportedTypesWithMissingComments(
            Assembly assembly,
            List <Type>?excludeTypes = null)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException(nameof(assembly));
            }

            // Due to some build issue with GenerateDocumentationFile=true and xml-file location, this hack is made for now.
            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                return;
            }

            var typesWithMissingCommentsGroups = DocumentationHelper.CollectExportedTypesWithMissingCommentsFromAssembly(
                assembly,
                excludeTypes)
                                                 .OrderBy(x => x.Type.FullName)
                                                 .GroupBy(x => x.Type.BeautifyName(true), StringComparer.Ordinal)
                                                 .ToArray();

            var testResults = new List <TestResult>
            {
                new TestResult($"Assembly: {assembly.GetName()}"),
            };

            testResults.AddRange(typesWithMissingCommentsGroups.Select(item => new TestResult(false, 1, $"Type: {item.Key}")));

            TestResultHelper.AssertOnTestResults(testResults);
        }
示例#2
0
        /// <summary>
        /// Asserts the exported types with missing comments.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <param name="excludeTypes">The exclude types.</param>
        public static void AssertExportedTypesWithMissingComments(
            Assembly assembly,
            List <Type>?excludeTypes = null)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException(nameof(assembly));
            }

            var typesWithMissingCommentsGroups = DocumentationHelper.CollectExportedTypesWithMissingCommentsFromAssembly(
                assembly,
                excludeTypes)
                                                 .OrderBy(x => x.Type.FullName)
                                                 .GroupBy(x => x.Type.BeautifyName(true))
                                                 .ToArray();

            var testResults = new List <TestResult>
            {
                new TestResult($"Assembly: {assembly.GetName()}"),
            };

            testResults.AddRange(typesWithMissingCommentsGroups.Select(item => new TestResult(false, 1, $"Type: {item.Key}")));

            TestResultHelper.AssertOnTestResults(testResults);
        }