public FakeNuGetProject AddNuGetProject(IDotNetProject project) { var nugetProject = new FakeNuGetProject(project); nugetProjects[project] = nugetProject; return(nugetProject); }
void CreateAction ( string packageId = "Test", string version = "2.1") { project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj"); solutionManager = new FakeSolutionManager (); nugetProject = new FakeNuGetProject (project); solutionManager.NuGetProjects[project] = nugetProject; var repositoryProvider = solutionManager.SourceRepositoryProvider; var source = new PackageSource ("http://test.com"); repositoryProvider.AddRepository (source); primaryRepositories = repositoryProvider.Repositories; action = new TestableReinstallNuGetPackageAction ( project, solutionManager); packageManagementEvents = action.PackageManagementEvents; fileRemover = action.FileRemover; action.PackageId = packageId; action.Version = new NuGetVersion (version); uninstallPackageManager = action.UninstallAction.PackageManager; installPackageManager = action.InstallAction.PackageManager; }
void CreateAction () { project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj"); solutionManager = new FakeSolutionManager (); nugetProject = new FakeNuGetProject (project); solutionManager.NuGetProjects[project] = nugetProject; var metadataResourceProvider = new FakePackageMetadataResourceProvider (); packageMetadataResource = metadataResourceProvider.PackageMetadataResource; var source = new PackageSource ("http://test.com"); var providers = new INuGetResourceProvider[] { metadataResourceProvider }; var sourceRepository = new SourceRepository (source, providers); primaryRepositories = new [] { sourceRepository }.ToList (); solutionManager.SourceRepositoryProvider.Repositories.AddRange (primaryRepositories); action = new TestableUpdateAllNuGetPackagesInProjectAction ( solutionManager, project); packageManager = action.PackageManager; packageManagementEvents = action.PackageManagementEvents; fileRemover = action.FileRemover; restoreManager = action.RestoreManager; }
void CreateAction ( string packageId = "Test", string version = "2.1") { project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj"); solutionManager = new FakeSolutionManager (); nugetProject = new FakeNuGetProject (project); solutionManager.NuGetProjects[project] = nugetProject; var metadataResourceProvider = new FakePackageMetadataResourceProvider (); packageMetadataResource = metadataResourceProvider.PackageMetadataResource; var source = new PackageSource ("http://test.com"); var providers = new INuGetResourceProvider[] { metadataResourceProvider }; var sourceRepository = new SourceRepository (source, providers); primaryRepositories = new [] { sourceRepository }.ToList (); action = new TestableInstallNuGetPackageAction ( primaryRepositories, solutionManager, project); packageManager = action.PackageManager; packageManagementEvents = action.PackageManagementEvents; fileRemover = action.FileRemover; action.PackageId = packageId; action.Version = new NuGetVersion (version); }
public NuGetProject GetNuGetProject(IDotNetProject project) { FakeNuGetProject nugetProject = null; if (NuGetProjects.TryGetValue(project, out nugetProject)) { return(nugetProject); } return(new FakeNuGetProject(project)); }
void CreateAction (string packageId = "Test") { project = new FakeDotNetProject (@"d:\projects\MyProject\MyProject.csproj"); solutionManager = new FakeSolutionManager (); nugetProject = new FakeNuGetProject (project); solutionManager.NuGetProjects[project] = nugetProject; action = new TestableUninstallNuGetPackageAction ( solutionManager, project); packageManager = action.PackageManager; action.PackageId = packageId; }