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();
        }
        public void TargetFrameworkAppearsVerbatimInOutput(string targetFramework)
        {
            var console = new ConsoleMock();

            var nuspecBuilder = new NuspecBuilder("anyAssemblyName");
            var anyDependencies = new List<ManifestDependency>{new ManifestDependency {Id="anyDependency", Version = "0.0.0.0"}};
            nuspecBuilder.SetDependencies(anyDependencies, targetFramework);
            nuspecBuilder.Save(console.Object);

            var nuspecContents = File.ReadAllText(nuspecBuilder.FilePath);
            var expectedAssemblyGroupStartTag = string.Format("<group targetFramework=\"{0}\">", targetFramework);
            Assert.That(nuspecContents, Contains.Substring(expectedAssemblyGroupStartTag));
            console.AssertConsoleHasNoErrorsOrWarnings();
        }
        private void NugetifyProject(IVsProject projectAdapter, DirectoryInfo solutionRoot, ISharedPackageRepository existingSolutionPackagesRepo)
        {
            var projectNugetifier = CreateProjectNugetifier(projectAdapter);
            var packagesAdded = projectNugetifier.NugetifyReferences(solutionRoot);
            projectNugetifier.AddNugetReferenceMetadata(existingSolutionPackagesRepo, packagesAdded);
            projectAdapter.Save();

            if (NuSpec)
            {
                var manifestDependencies = projectNugetifier.GetManifestDependencies(packagesAdded);
                var nuspecBuilder = new NuspecBuilder(projectAdapter.AssemblyName);
                nuspecBuilder.SetMetadata(this, manifestDependencies);
                nuspecBuilder.SetDependencies(manifestDependencies);
                nuspecBuilder.Save(Console);
            }
        }