コード例 #1
0
		public FakePackageManagementProject(string name)
		{
			FakeInstallPackageAction = new FakeInstallPackageAction(this);
			FakeUninstallPackageAction = new FakeUninstallPackageAction(this);
			
			this.Name = name;
		}
コード例 #2
0
        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;
            };
        }
コード例 #3
0
		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;
			};
		}
コード例 #4
0
		void CreateInstallActionWithNoPowerShellScripts()
		{
			var fakeProject = new FakePackageManagementProject();
			fakeAction = new FakeInstallPackageAction(fakeProject);
			fakeAction.Operations = new PackageOperation[0];
			fakeActions.Add(fakeAction);
		}
コード例 #5
0
		FakeInstallPackageAction AddInstallAction()
		{
			var project = new FakePackageManagementProject();
			var action = new FakeInstallPackageAction(project);
			actionsToRun.AddAction(action);
			return action;
		}
コード例 #6
0
        public FakePackageManagementProject(string name)
        {
            FakeInstallPackageAction   = new FakeInstallPackageAction(this);
            FakeUninstallPackageAction = new FakeUninstallPackageAction(this);

            this.Name = name;
        }
コード例 #7
0
		FakeInstallPackageAction CreateInstallAction()
		{
			var project = new FakePackageManagementProject();
			var action = new FakeInstallPackageAction(project);
			action.Operations = new PackageOperation[0];
			return action;
		}
コード例 #8
0
		void CreateCmdletWithoutActiveProject()
		{
			cmdlet = new TestableInstallPackageCmdlet();
			fakeTerminatingError = cmdlet.FakeCmdletTerminatingError;
			fakeConsoleHost = cmdlet.FakePackageManagementConsoleHost;
			fakeProject = fakeConsoleHost.FakeProject;
			fakeInstallPackageAction = fakeProject.FakeInstallPackageAction;
		}
コード例 #9
0
		public FakePackageManagementProject()
		{
			FakeInstallPackageAction = new FakeInstallPackageAction(this);
			FakeUninstallPackageAction = new FakeUninstallPackageAction(this);
			FakeUpdatePackageAction = new FakeUpdatePackageAction(this);
			
			Name = "Test";
		}
コード例 #10
0
		public FakePackageManagementProject(string name)
		{
			FakeInstallPackageAction = new FakeInstallPackageAction(this);
			FakeUninstallPackageAction = new FakeUninstallPackageAction(this);
			
			this.Name = name;
			
			ConstraintProvider = NullConstraintProvider.Instance;
		}
コード例 #11
0
        public FakePackageManagementProject(string name)
        {
            FakeInstallPackageAction   = new FakeInstallPackageAction(this);
            FakeUninstallPackageAction = new FakeUninstallPackageAction(this);

            this.Name = name;

            ConstraintProvider = NullConstraintProvider.Instance;
        }
コード例 #12
0
        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"));
        }
コード例 #13
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;
		}
コード例 #14
0
		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;
		}
コード例 #15
0
		FakeInstallPackageAction CreateFakeInstallAction()
		{
			fakeInstallAction = new FakeInstallPackageAction();
			return fakeInstallAction;
		}
コード例 #16
0
		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));
		}
コード例 #17
0
		public virtual InstallPackageAction CreateInstallPackageAction()
		{
			LastInstallPackageCreated = new FakeInstallPackageAction(this);
			return LastInstallPackageCreated;
		}
コード例 #18
0
 public virtual InstallPackageAction CreateInstallPackageAction()
 {
     LastInstallPackageCreated = new FakeInstallPackageAction(this);
     return(LastInstallPackageCreated);
 }
コード例 #19
0
		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;
		}
コード例 #20
0
		IEnumerable<PackageOperation> GetInstallPackageOperations(
			FakePackage package,
			bool ignoreDependencies,
			bool allowPrereleaseVersions)
		{
			var fakeInstallAction = new FakeInstallPackageAction();
			fakeInstallAction.IgnoreDependencies = ignoreDependencies;
			fakeInstallAction.AllowPrereleaseVersions = allowPrereleaseVersions;
			return packageManager.GetInstallPackageOperations(package, fakeInstallAction);
		}