public void PackageReader_NestedReferenceItemsMixed() { using (var packageFile = TestPackagesCore.GetLibEmptyFolderPackage()) { var zip = TestPackagesCore.GetZip(packageFile); using (PackageArchiveReader reader = new PackageArchiveReader(zip)) { var groups = reader.GetReferenceItems().ToArray(); Assert.Equal(3, groups.Count()); Assert.Equal(NuGetFramework.AnyFramework, groups[0].TargetFramework); Assert.Equal(2, groups[0].Items.Count()); Assert.Equal("lib/a.dll", groups[0].Items.ToArray()[0]); Assert.Equal("lib/x86/b.dll", groups[0].Items.ToArray()[1]); Assert.Equal(NuGetFramework.Parse("net40"), groups[1].TargetFramework); Assert.Equal(2, groups[1].Items.Count()); Assert.Equal("lib/net40/test40.dll", groups[1].Items.ToArray()[0]); Assert.Equal("lib/net40/x86/testx86.dll", groups[1].Items.ToArray()[1]); Assert.Equal(NuGetFramework.Parse("net45"), groups[2].TargetFramework); Assert.Equal(0, groups[2].Items.Count()); } } }
public void PackageReader_EmptyLibFolder() { using (var packageFile = TestPackagesCore.GetLibEmptyFolderPackage()) { var zip = TestPackagesCore.GetZip(packageFile); using (PackageArchiveReader reader = new PackageArchiveReader(zip)) { var groups = reader.GetReferenceItems().ToArray(); var emptyGroup = groups.Where(g => g.TargetFramework == NuGetFramework.ParseFolder("net45")).Single(); Assert.Equal(0, emptyGroup.Items.Count()); } } }