public void ScriptsOutsideToolsFolder()
{
// Arrange
var package = PackageUtility.CreatePackage(
"A",
content: new[] { "install.ps1" },
assemblyReferences: new[] { "init.ps1" }
);
var rule = new MisplacedScriptFileRule();
// Act
IList<PackageIssue> issues = rule.Validate(package).ToList();
// Assert
Assert.Equal(2, issues.Count);
PackageIssueTestHelper.AssertPackageIssue(
issues[0],
"PowerShell file outside tools folder.",
"The script file 'content\\install.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package.",
"Move it into the 'tools' folder.");
PackageIssueTestHelper.AssertPackageIssue(
issues[1],
"PowerShell file outside tools folder.",
"The script file 'init.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package.",
"Move it into the 'tools' folder.");
}