Exemple #1
0
        public IEnumerable <PackageVerifierIssue> Validate(PackageAnalysisContext context)
        {
            if (context.Metadata.Authors == null || !context.Metadata.Authors.Any())
            {
                yield return(PackageIssueFactory.RequiredAuthor());
            }

            if (context.Metadata.Authors.Count() > 1)
            {
                yield return(PackageIssueFactory.SingleAuthorOnly(context.Metadata.Id));
            }

            var author = context.Metadata.Authors.First();

            if (!string.Equals(author, _expectedAuthor, StringComparison.Ordinal))
            {
                yield return(PackageIssueFactory.AuthorIsIncorrect(context.Metadata.Id, _expectedAuthor, author));
            }
        }