public void SingleDependencyWithCorrespondingPackageGetsNugetted() { var singleDependency = ProjectReferenceTestData.ConstructMockDependency(); var projectWithSingleDependency = ProjectReferenceTestData.ConstructMockProject(new[] { singleDependency.Object }); var packageRepositoryWithCorrespondingPackage = ProjectReferenceTestData.CreateMockRepository(); var nugetifier = ReferenceNugetifierTester.BuildNugetifier(vsProject: projectWithSingleDependency, packageRepository: packageRepositoryWithCorrespondingPackage); ReferenceNugetifierTester.NugetifyReferencesInProject(nugetifier); singleDependency.Verify(binaryDependency => binaryDependency.ConvertToNugetReferenceWithHintPath(It.IsAny <string>()), Times.Once()); }
public void SingleDependencyWithoutCorrespondingPackageNotNugetted() { var singleDependency = ProjectReferenceTestData.ConstructMockDependency(); var projectWithSingleDependency = ProjectReferenceTestData.ConstructMockProject(new[] { singleDependency.Object }); var nugetifier = ReferenceNugetifierTester.BuildNugetifier(vsProject: projectWithSingleDependency); ReferenceNugetifierTester.NugetifyReferencesInProject(nugetifier); singleDependency.Verify(binaryDependency => binaryDependency.ConvertToNugetReferenceWithHintPath(It.IsAny <string>()), Times.Never()); }
public void PackageFoundForDependencyWithNoHintPath() { var singleDependency = ProjectReferenceTestData.ConstructMockDependency(hasHintpath: false); var projectWithSingleDependency = ProjectReferenceTestData.ConstructMockProject(new[] { singleDependency.Object }); var packageRepositoryWithOnePackage = ProjectReferenceTestData.CreateMockRepository(); var nugetifier = ReferenceNugetifierTester.BuildNugetifier(vsProject: projectWithSingleDependency, packageRepository: packageRepositoryWithOnePackage); var nugettedDependencies = ReferenceNugetifierTester.NugetifyReferencesInProject(nugetifier); Assert.That(nugettedDependencies, Is.Not.Empty); Assert.That(nugettedDependencies.Single().Id, Contains.Substring(ProjectReferenceTestData.PackageInRepository)); }
public void TwoDependenciesWithCorrespondingPackagesGetNugetted() { var defaultDependency = ProjectReferenceTestData.ConstructMockDependency(ProjectReferenceTestData.AssemblyFilenameInPackageRepository); var secondDependency = ProjectReferenceTestData.ConstructMockDependency(ProjectReferenceTestData.AnotherAssemblyInPackageRepository); var projectWithSingleDependency = ProjectReferenceTestData.ConstructMockProject(new[] { defaultDependency.Object, secondDependency.Object }); var packageRepositoryWithCorrespondingPackage = ProjectReferenceTestData.CreateMockRepository(); var nugetifier = ReferenceNugetifierTester.BuildNugetifier(vsProject: projectWithSingleDependency, packageRepository: packageRepositoryWithCorrespondingPackage); ReferenceNugetifierTester.NugetifyReferencesInProject(nugetifier); defaultDependency.Verify(d => d.ConvertToNugetReferenceWithHintPath(It.IsAny <string>()), Times.Once()); secondDependency.Verify(d => d.ConvertToNugetReferenceWithHintPath(It.IsAny <string>()), Times.Once()); }