public void AssemblyInsideLibHasNoIssue()
        {
            // Arrange
            var package = PackageUtility.CreatePackage("A", assemblyReferences: new[] { "lib\\abc.dll", "def\\def.winmd" });
            var rule    = new NonAssemblyInsideLibRule();

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

            // Assert
            Assert.False(issues.Any());
        }
        public void NormalPackageHasNoIssue()
        {
            // Arrange
            var package = PackageUtility.CreatePackage("A", content: new[] { "one.js" });
            var rule    = new NonAssemblyInsideLibRule();

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

            // Assert
            Assert.False(issues.Any());
        }
        public void PdbFileAndXmlFilesAreNotWarned()
        {
            // Arrange
            var package = PackageUtility.CreatePackage(
                "A",
                assemblyReferences: new[] { "lib\\one.dll", "lib\\one.xml", "lib\\sl4\\wow.pdb", "lib\\sl4\\wow.exe" });
            var rule = new NonAssemblyInsideLibRule();

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

            // Assert
            Assert.False(issues.Any());
        }
        public void NonAssemblyInsideLibHasIssue()
        {
            // Arrange
            var package = PackageUtility.CreatePackage(
                "A",
                assemblyReferences: new[] { "lib\\one.dll", "lib\\abc.xml", "lib\\sl4\\wow.pdb", "lib\\net\\4.0\\kac.txt" });
            var rule = new NonAssemblyInsideLibRule();

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

            // Assert
            Assert.Equal(3, issues.Count);
            AssertPackageIssueWithPath(issues[0], "lib\\abc.xml");
            AssertPackageIssueWithPath(issues[1], "lib\\sl4\\wow.pdb");
            AssertPackageIssueWithPath(issues[2], "lib\\net\\4.0\\kac.txt");
        }