public void GenerateWarnings_PackageWithSubFoldersThatAreCorrect_ShouldNotWarn() { //Arrange & Act var rule = new ReferencesInNuspecMatchRefAssetsRule(); var missingReferences = Array.Empty <MissingReference>(); var issues = rule.GenerateWarnings(missingReferences); //Assert Assert.Empty(issues); }
public void GenerateWarnings_PackageWithAssetsMissingFromTheRefFolder_ShouldWarn() { //Arrange & Act var rule = new ReferencesInNuspecMatchRefAssetsRule(); var missingReferences = new List <MissingReference> { new MissingReference("ref", "net462", new string[] { "MyHelpers.dll" }) }; var issues = rule.GenerateWarnings(missingReferences); //Assert Assert.Equal(issues.Count(), 1); var singleIssue = issues.Single(t => t.Code == NuGetLogCode.NU5131); var expectedMessage = "References were found in the nuspec, but some reference assemblies were not found in both the nuspec and ref folder. Add the following reference assemblies:" + Environment.NewLine + "- Add MyHelpers.dll to the ref/net462/ directory" + Environment.NewLine; Assert.Equal(singleIssue.Message, expectedMessage); }