public void SinglePackageShouldBePopulated() { var reader = MakeReader(); var packages = reader.Read(StreamFromString(PackagesFileWithSinglePackage), TempPath()); var package = packages.FirstOrDefault(); PackageAssert.IsPopulated(package); }
public void WhenOnePackageCannotBeRead_TheOthersAreStillRead() { var badVersion = PackagesFileWithTwoPackages.Replace("1.2.3.4", "notaversion"); var reader = MakeReader(); var packages = reader.Read(StreamFromString(badVersion), TempPath()) .ToList(); Assert.That(packages.Count, Is.EqualTo(1)); PackageAssert.IsPopulated(packages[0]); }
public void TwoPackagesShouldBePopulated() { var reader = MakeReader(); var packages = reader.Read(StreamFromString(PackagesFileWithTwoPackages), TempPath()) .ToList(); Assert.That(packages, Is.Not.Null); Assert.That(packages.Count, Is.EqualTo(2)); PackageAssert.IsPopulated(packages[0]); PackageAssert.IsPopulated(packages[1]); }
public void SinglePackageIsPopulated() { const string packagesText = @"<PackageReference Include=""foo"" Version=""1.2.3""></PackageReference>"; var projectFile = Vs2017ProjectFileTemplateWithPackages.Replace("{{Packages}}", packagesText); var reader = MakeReader(); var packages = reader.Read(StreamFromString(projectFile), SampleDirectory, SampleFile); var package = packages.FirstOrDefault(); PackageAssert.IsPopulated(package); }
public void ResultIsReiterable() { var path = TempPath(); var reader = MakeReader(); var packages = reader.Read(StreamFromString(PackagesFileWithTwoPackages), path); foreach (var package in packages) { PackageAssert.IsPopulated(package); } Assert.That(packages.Select(p => p.Path), Is.All.EqualTo(path)); }
public void WhenOnePackageCannotBeRead_TheOthersAreStillRead() { const string packagesText = @"<PackageReference Include=""foo"" Version=""notaversion""></PackageReference> <PackageReference Include=""bar"" Version=""2.3.4""></PackageReference>"; var projectFile = Vs2017ProjectFileTemplateWithPackages.Replace("{{Packages}}", packagesText); var reader = MakeReader(); var packages = reader.Read(StreamFromString(projectFile), SampleDirectory, SampleFile) .ToList(); Assert.That(packages.Count, Is.EqualTo(1)); PackageAssert.IsPopulated(packages[0]); }
public void WhenTwoPackagesAreRead_TheyArePopulated() { const string packagesText = @"<PackageReference Include=""foo"" Version=""1.2.3""></PackageReference> <PackageReference Include=""bar"" Version=""2.3.4""></PackageReference>"; var projectFile = Vs2017ProjectFileTemplateWithPackages.Replace("{{Packages}}", packagesText); var reader = MakeReader(); var packages = reader.Read(StreamFromString(projectFile), SampleDirectory, SampleFile) .ToList(); Assert.That(packages, Is.Not.Null); Assert.That(packages.Count, Is.EqualTo(2)); PackageAssert.IsPopulated(packages[0]); PackageAssert.IsPopulated(packages[1]); }