public void AssemblyNameReplacesNullDescription() { var console = new ConsoleMock(); const string anyAssemblyName = "any.assembly.name"; var nullDataSource = new Mock <INuspecDataSource>().Object; var nuspecBuilder = new NuspecBuilder(anyAssemblyName); nuspecBuilder.SetMetadata(nullDataSource, new List <ManifestDependency>()); nuspecBuilder.Save(console.Object); var nuspecContents = File.ReadAllText(nuspecBuilder.FilePath); Assert.That(nuspecContents, Contains.Substring("<description>" + anyAssemblyName + "</description>")); console.AssertConsoleHasNoErrorsOrWarnings(); }
private void NugetifyProject(IVsProject projectAdapter, DirectoryInfo solutionRoot, ISharedPackageRepository existingSolutionPackagesRepo) { var targetFramework = TargetFramework != null?VersionUtility.ParseFrameworkName(TargetFramework) : null; var projectNugetifier = CreateProjectNugetifier(projectAdapter); var packagesAdded = projectNugetifier.NugetifyReferences(solutionRoot); projectNugetifier.AddNugetReferenceMetadata(existingSolutionPackagesRepo, packagesAdded, targetFramework); projectAdapter.Save(); if (NuSpec) { var manifestDependencies = projectNugetifier.GetManifestDependencies(packagesAdded); var nuspecBuilder = new NuspecBuilder(projectAdapter.AssemblyName); nuspecBuilder.SetMetadata(this, manifestDependencies); nuspecBuilder.SetDependencies(manifestDependencies, TargetFramework); nuspecBuilder.Save(Console); } }