コード例 #1
0
        public void HasDuplicateMetadataElementsCaseSensitive()
        {
            // Arrange
            var nuspec = Resources.LoadXml(Resources.Nuspecs.DuplicateMetadataElements);

            // Act
            var output = NuspecUtility.GetDuplicateMetadataElements(nuspec, caseSensitive: true);

            // Assert
            Assert.NotEmpty(output);
            Assert.Equal(new[] { "authors", "dependencies", "owners" }, output.Keys.OrderBy(x => x));
            Assert.Equal(3, output["authors"]);
            Assert.Equal(2, output["dependencies"]);
            Assert.Equal(2, output["owners"]);
        }
コード例 #2
0
 public bool IsMatch(XDocument nuspec)
 {
     return(NuspecUtility
            .GetDuplicateMetadataElements(nuspec, caseSensitive: true)
            .Any());
 }