public FakePackageManagementProject(string name) { FakeInstallPackageAction = new FakeInstallPackageAction(this); FakeUninstallPackageAction = new FakeUninstallPackageAction(this); this.Name = name; }
public FakePackageManagementProject(string name) { FakeInstallPackageAction = new FakeInstallPackageAction(this); FakeUninstallPackageAction = new FakeUninstallPackageAction(this); this.Name = name; ConstraintProvider = NullConstraintProvider.Instance; TargetFramework = new FrameworkName(".NETFramework", new Version("4.0")); InstallPackageAction = (package, installAction) => { PackagePassedToInstallPackage = package; PackageOperationsPassedToInstallPackage = installAction.Operations; IgnoreDependenciesPassedToInstallPackage = installAction.IgnoreDependencies; AllowPrereleaseVersionsPassedToInstallPackage = installAction.AllowPrereleaseVersions; }; UpdatePackageAction = (package, updateAction) => { PackagePassedToUpdatePackage = package; PackageOperationsPassedToUpdatePackage = updateAction.Operations; UpdateDependenciesPassedToUpdatePackage = updateAction.UpdateDependencies; AllowPrereleaseVersionsPassedToUpdatePackage = updateAction.AllowPrereleaseVersions; IsUpdatePackageCalled = true; }; }
void CreateInstallActionWithNoPowerShellScripts() { var fakeProject = new FakePackageManagementProject(); fakeAction = new FakeInstallPackageAction(fakeProject); fakeAction.Operations = new PackageOperation[0]; fakeActions.Add(fakeAction); }
FakeInstallPackageAction AddInstallAction() { var project = new FakePackageManagementProject(); var action = new FakeInstallPackageAction(project); actionsToRun.AddAction(action); return action; }
FakeInstallPackageAction CreateInstallAction() { var project = new FakePackageManagementProject(); var action = new FakeInstallPackageAction(project); action.Operations = new PackageOperation[0]; return action; }
void CreateCmdletWithoutActiveProject() { cmdlet = new TestableInstallPackageCmdlet(); fakeTerminatingError = cmdlet.FakeCmdletTerminatingError; fakeConsoleHost = cmdlet.FakePackageManagementConsoleHost; fakeProject = fakeConsoleHost.FakeProject; fakeInstallPackageAction = fakeProject.FakeInstallPackageAction; }
public FakePackageManagementProject() { FakeInstallPackageAction = new FakeInstallPackageAction(this); FakeUninstallPackageAction = new FakeUninstallPackageAction(this); FakeUpdatePackageAction = new FakeUpdatePackageAction(this); Name = "Test"; }
public FakePackageManagementProject(string name) { FakeInstallPackageAction = new FakeInstallPackageAction(this); FakeUninstallPackageAction = new FakeUninstallPackageAction(this); this.Name = name; ConstraintProvider = NullConstraintProvider.Instance; }
public FakePackageManagementProject(string name) { FakeInstallPackageAction = new FakeInstallPackageAction(this); FakeUninstallPackageAction = new FakeUninstallPackageAction(this); this.Name = name; ConstraintProvider = NullConstraintProvider.Instance; TargetFramework = new FrameworkName(".NETFramework", new Version("4.0")); }
void CreateViewModel(FakePackageManagementSolution solution) { viewModel = new TestablePackageViewModel(solution); fakePackage = viewModel.FakePackage; this.fakeSolution = solution; fakePackageManagementEvents = viewModel.FakePackageManagementEvents; fakeLogger = viewModel.FakeLogger; fakeInstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeInstallPackageAction; fakeUninstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeUninstallPackageAction; fakeActionRunner = viewModel.FakeActionRunner; }
FakePackage InstallPackageWithNoPackageOperations(bool ignoreDependencies, bool allowPrereleaseVersions) { FakePackage package = CreateFakePackage(); var operations = new List<PackageOperation>(); var installAction = new FakeInstallPackageAction(); installAction.IgnoreDependencies = ignoreDependencies; installAction.AllowPrereleaseVersions = allowPrereleaseVersions; installAction.Operations = operations; packageManager.InstallPackage(package, installAction); return package; }
FakeInstallPackageAction CreateFakeInstallAction() { fakeInstallAction = new FakeInstallPackageAction(); return fakeInstallAction; }
public void InstallPackage_OldPackageReferenceIsRemovedOnInstallingButOtherProjectsReferencesOldPackage_OldPackageIsNotUninstalled() { CreatePackageManager(); var fakeProjectManager = MockRepository.GenerateStub<ISharpDevelopProjectManager>(); packageManager.ProjectManager = fakeProjectManager; FakePackage installedPackage = fakeSolutionSharedRepository.AddFakePackageWithVersion("MyPackage.Core", "1.0"); FakePackage newPackage = fakeFeedSourceRepository.AddFakePackageWithVersion("MyPackage", "1.1"); fakeSolutionSharedRepository.PackageIdsReferences.Add("MyPackage.Core"); var eventArgs = new PackageOperationEventArgs(installedPackage, null, null); RaisePackageRemovedEventWhenPackageReferenceAdded(fakeProjectManager, newPackage, eventArgs); var installAction = new FakeInstallPackageAction { Operations = new List<PackageOperation>() }; packageManager.InstallPackage(newPackage, installAction); Assert.IsTrue(fakeSolutionSharedRepository.FakePackages.Contains(installedPackage)); }
public virtual InstallPackageAction CreateInstallPackageAction() { LastInstallPackageCreated = new FakeInstallPackageAction(this); return LastInstallPackageCreated; }
public virtual InstallPackageAction CreateInstallPackageAction() { LastInstallPackageCreated = new FakeInstallPackageAction(this); return(LastInstallPackageCreated); }
FakePackage InstallPackageWithPackageOperations(PackageOperation operation) { var operations = new PackageOperation[] { operation }; FakePackage package = CreateFakePackage(); var installAction = new FakeInstallPackageAction(); installAction.Operations = operations; packageManager.InstallPackage(package, installAction); return package; }
IEnumerable<PackageOperation> GetInstallPackageOperations( FakePackage package, bool ignoreDependencies, bool allowPrereleaseVersions) { var fakeInstallAction = new FakeInstallPackageAction(); fakeInstallAction.IgnoreDependencies = ignoreDependencies; fakeInstallAction.AllowPrereleaseVersions = allowPrereleaseVersions; return packageManager.GetInstallPackageOperations(package, fakeInstallAction); }