コード例 #1
0
        public void PackageWithNoLibFolderHasNoIssue()
        {
            // Arrange
            var package = PackageUtility.CreatePackage("A", content: new[] { "one", "two" });
            var rule = new InvalidFrameworkFolderRule();

            // Act
            IEnumerable<PackageIssue> issues = rule.Validate(package);

            // Assert
            Assert.False(issues.Any());
        }
コード例 #2
0
        public void PackageWithValidFrameworkNamesHasNoIssue()
        {
            // Arrange
            var package = PackageUtility.CreatePackage(
                "A",
                content: new[] { "one", "two" },
                assemblyReferences: new[] { "lib\\sl4\\abc.dll" });
            var rule = new InvalidFrameworkFolderRule();

            // Act
            IEnumerable<PackageIssue> issues = rule.Validate(package);

            // Assert
            Assert.False(issues.Any());
        }
コード例 #3
0
        public void PackageWithValidCultureFolderHasNoIssue(string culture)
        {
            // Arrange
            var package = PackageUtility.CreatePackage(
                "A",
                content: new[] { "one", "two" },
                assemblyReferences: new[] { "lib\\" + culture + "\\abc.dll" }, 
                language: culture);
            var rule = new InvalidFrameworkFolderRule();

            // Act
            IList<PackageIssue> issues = rule.Validate(package).ToList();

            // Assert
            Assert.Equal(0, issues.Count);
        }
コード例 #4
0
        public void PackageWithInvalidFrameworkNamesHasOneIssue(string folder)
        {
            // Arrange
            var package = PackageUtility.CreatePackage(
                "A",
                content: new[] { "one", "two" },
                assemblyReferences: new[] { "lib\\" + folder + "\\abc.dll" });
            var rule = new InvalidFrameworkFolderRule();

            // Act
            IList<PackageIssue> issues = rule.Validate(package).ToList();

            // Assert
            Assert.Equal(1, issues.Count);
            PackageIssueTestHelper.AssertPackageIssue(
                issues[0],
                "Invalid framework folder.",
                "The folder '" + folder + "' under 'lib' is not recognized as a valid framework name or a supported culture identifier.",
                "Rename it to a valid framework name.");
        }