public TestablePackageViewModel(
            IPackageViewModelParent parent,
            FakePackage package,
            PackageManagementSelectedProjects selectedProjects,
            FakePackageManagementEvents packageManagementEvents,
            FakePackageActionRunner actionRunner,
            FakeLogger logger)
            : base(
                parent,
                package,
                selectedProjects,
                packageManagementEvents,
                actionRunner,
                logger)
        {
            this.FakePackage = package;
            this.FakePackageManagementEvents = packageManagementEvents;
            this.FakeActionRunner            = actionRunner;
            this.FakeLogger = logger;

            IsProjectPackageReturnsValue = true;
            IsProjectPackageIsCalled     = false;

            IsProjectPackageAction = p => {
                IsProjectPackageIsCalled = true;
                return(IsProjectPackageReturnsValue);
            };
        }
 public PackageViewModel(
     IPackageViewModelParent parent,
     IPackageFromRepository package)
 {
     this.parent  = parent;
     this.package = package;
 }
        public TestablePackageViewModel(
			IPackageViewModelParent parent,
			FakePackage package,
			PackageManagementSelectedProjects selectedProjects,
			FakePackageManagementEvents packageManagementEvents,
			FakePackageActionRunner actionRunner,
			FakeLogger logger)
            : base(parent,
				package,
				selectedProjects,
				packageManagementEvents,
				actionRunner,
				logger)
        {
            this.FakePackage = package;
            this.FakePackageManagementEvents = packageManagementEvents;
            this.FakeActionRunner = actionRunner;
            this.FakeLogger = logger;

            IsProjectPackageReturnsValue = true;
            IsProjectPackageIsCalled = false;

            IsProjectPackageAction = p => {
                IsProjectPackageIsCalled = true;
                return IsProjectPackageReturnsValue;
            };
        }
 void CreateViewModel(FakePackageManagementSolution fakeSolution)
 {
     viewModelParent             = MockRepository.GenerateStub <IPackageViewModelParent>();
     viewModel                   = new TestableUpdatedPackageViewModel(viewModelParent, fakeSolution);
     fakeProject                 = fakeSolution.FakeProjectToReturnFromGetProject;
     fakeActionRunner            = viewModel.FakeActionRunner;
     fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
 }
		void CreateViewModel(FakePackageManagementSolution fakeSolution)
		{
			viewModelParent = MockRepository.GenerateStub<IPackageViewModelParent>();
			viewModel = new TestableUpdatedPackageViewModel(viewModelParent, fakeSolution);
			fakeProject = fakeSolution.FakeProjectToReturnFromGetProject;
			fakeActionRunner = viewModel.FakeActionRunner;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
		}
		public UpdatedPackageViewModel(
			IPackageViewModelParent parent,
			IPackageFromRepository package,
			SelectedProjectsForUpdatedPackages selectedProjects,
			IPackageManagementEvents packageManagementEvents,
			IPackageActionRunner actionRunner,
			ILogger logger)
			: base(parent, package, selectedProjects, packageManagementEvents, actionRunner, logger)
		{
		}
Ejemplo n.º 7
0
 public UpdatedPackageViewModel(
     IPackageViewModelParent parent,
     IPackageFromRepository package,
     SelectedProjectsForUpdatedPackages selectedProjects,
     IPackageManagementEvents packageManagementEvents,
     IPackageActionRunner actionRunner,
     ILogger logger)
     : base(parent, package, selectedProjects, packageManagementEvents, actionRunner, logger)
 {
 }
Ejemplo n.º 8
0
 public virtual PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
 {
     return(new PackageViewModel(
                parent,
                package,
                SelectedProjects,
                PackageManagementEvents,
                PackageActionRunner,
                Logger));
 }
 public override PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
 {
     return(new UpdatedPackageViewModel(
                parent,
                package,
                selectedProjectsForUpdatedPackages,
                PackageManagementEvents,
                PackageActionRunner,
                Logger));
 }
		public virtual PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
		{
			return new PackageViewModel(
				parent,
				package,
				SelectedProjects,
				PackageManagementEvents,
				PackageActionRunner,
				Logger);
		}
        void CreateViewModel()
        {
            IPackageViewModelParent parent = MockRepository.GenerateStub <IPackageViewModelParent>();

            viewModel                   = new TestableInstalledPackageViewModel(parent);
            fakeSolution                = viewModel.FakeSolution;
            fakeActionRunner            = viewModel.FakeActionRunner;
            fakePackage                 = viewModel.FakePackage;
            fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
        }
		public override PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
		{
			return new UpdatedPackageViewModel(
				parent,
				package,
				selectedProjectsForUpdatedPackages,
				PackageManagementEvents,
				PackageActionRunner,
				Logger);
		}
Ejemplo n.º 13
0
		void CreateViewModel(FakePackageManagementSolution solution)
		{
			viewModelParent = MockRepository.GenerateStub<IPackageViewModelParent>();
			viewModel = new TestablePackageViewModel(viewModelParent, solution);
			fakePackage = viewModel.FakePackage;
			this.fakeSolution = solution;
			fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
			fakeLogger = viewModel.FakeLogger;
			fakeUninstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeUninstallPackageAction;
			fakeActionRunner = viewModel.FakeActionRunner;
		}
		public PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
		{
			SelectedProjects = new PackageManagementSelectedProjects(FakeSolution);
			return new PackageViewModel(
				parent,
				package,
				SelectedProjects,
				FakePackageManagementEvents,
				FakeActionRunner,
				FakeLogger);
		}
 public PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
 {
     SelectedProjects = new PackageManagementSelectedProjects(FakeSolution);
     return(new PackageViewModel(
                parent,
                package,
                SelectedProjects,
                PackageManagementEvents,
                null,
                FakeLogger));
 }
        public TestableUpdatedPackageViewModel(
			IPackageViewModelParent parent,
			FakePackageManagementSolution solution)
            : this(parent,
				new FakePackage(),
				new SelectedProjectsForUpdatedPackages(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
        {
            this.FakeSolution = solution;
        }
Ejemplo n.º 17
0
		public TestablePackageViewModel (
			IPackageViewModelParent parent,
			FakePackageManagementSolution solution)
			: this (
				parent,
				new FakePackage ("Test"),
				new PackageManagementSelectedProjects (solution),
				new PackageManagementEvents (),
				new FakeLogger ())
		{
			this.FakeSolution = solution;
		}
 public TestablePackageViewModel(
     IPackageViewModelParent parent,
     FakePackageManagementSolution solution)
     : this(
         parent,
         new FakePackage("Test"),
         new PackageManagementSelectedProjects(solution),
         new PackageManagementEvents(),
         new FakeLogger())
 {
     this.FakeSolution = solution;
 }
        public TestableInstalledPackageViewModel(
			IPackageViewModelParent parent,
			FakePackageManagementSolution solution)
            : this(parent,
				new FakePackage(),
				new SelectedProjectsForInstalledPackages(solution),
				new FakePackageManagementEvents(),
				new FakePackageActionRunner(),
				new FakeLogger())
        {
            this.FakeSolution = solution;
            solution.FakeActiveMSBuildProject = ProjectHelper.CreateTestProject("MyProject");
        }
 public TestableUpdatedPackageViewModel(
     IPackageViewModelParent parent,
     FakePackageManagementSolution solution)
     : this(
         parent,
         new FakePackage(),
         new SelectedProjectsForUpdatedPackages(solution),
         new FakePackageManagementEvents(),
         new FakePackageActionRunner(),
         new FakeLogger())
 {
     this.FakeSolution = solution;
 }
        public void PackageViewModels_ChildViewModelParent_IsInstalledPackagesViewModel()
        {
            CreateViewModel();
            FakePackage package = AddPackageToProjectLocalRepository();

            viewModel.ReadPackages();
            CompleteReadPackagesTask();

            PackageViewModel        childViewModel = viewModel.PackageViewModels.First();
            IPackageViewModelParent parent         = childViewModel.GetParent();

            Assert.AreEqual(viewModel, parent);
        }
        public void PackageViewModels_ChildPackageViewModelParent_IsUpdatedPackagesViewModel()
        {
            CreateViewModel();
            AddPackageToLocalRepository("Test", "1.0.0.0");
            FakePackage newerPackage = AddPackageToActiveRepository("Test", "1.1.0.0");

            viewModel.ReadPackages();
            CompleteReadPackagesTask();

            PackageViewModel        childViewModel = viewModel.PackageViewModels.First();
            IPackageViewModelParent parent         = childViewModel.GetParent();

            Assert.AreEqual(viewModel, parent);
        }
Ejemplo n.º 23
0
 public TestableInstalledPackageViewModel(
     IPackageViewModelParent parent,
     FakePackageManagementSolution solution)
     : this(
         parent,
         new FakePackage(),
         new SelectedProjectsForInstalledPackages(solution),
         new FakePackageManagementEvents(),
         new FakePackageActionRunner(),
         new FakeLogger())
 {
     this.FakeSolution = solution;
     solution.FakeActiveMSBuildProject = ProjectHelper.CreateTestProject("MyProject");
 }
        public PackageViewModel(
            IPackageViewModelParent parent,
            IPackageFromRepository package,
            PackageManagementSelectedProjects selectedProjects,
            IPackageManagementEvents packageManagementEvents,
            IPackageActionRunner actionRunner,
            ILogger logger)
        {
            this.parent                  = parent;
            this.package                 = package;
            this.selectedProjects        = selectedProjects;
            this.packageManagementEvents = packageManagementEvents;
            this.actionRunner            = actionRunner;
            this.logger                  = CreateLogger(logger);

            CreateCommands();
        }
Ejemplo n.º 25
0
        public void PackageViewModels_GetParentOfPackageViewModel_ReturnsAvailablePackagesViewModel()
        {
            CreateViewModel();
            var package1 = new FakePackage("Test", "0.1.0.0");
            var package2 = new FakePackage("Test", "0.2.0.0");
            var packages = new FakePackage[] {
                package1, package2
            };

            registeredPackageRepositories.FakeActiveRepository.FakePackages.AddRange(packages);
            viewModel.ReadPackages();
            CompleteReadPackagesTask();
            PackageViewModel childViewModel = viewModel.PackageViewModels.First();

            IPackageViewModelParent parent = childViewModel.GetParent();

            Assert.AreEqual(viewModel, parent);
        }
 public TestablePackageViewModel(
     IPackageViewModelParent parent,
     FakePackage package,
     PackageManagementSelectedProjects selectedProjects,
     PackageManagementEvents packageManagementEvents,
     FakeLogger logger)
     : base(
         parent,
         package,
         selectedProjects,
         packageManagementEvents,
         null,
         logger)
 {
     this.FakePackage             = package;
     this.PackageManagementEvents = packageManagementEvents;
     this.FakeLogger = logger;
 }
Ejemplo n.º 27
0
		public TestablePackageViewModel (
			IPackageViewModelParent parent,
			FakePackage package,
			PackageManagementSelectedProjects selectedProjects,
			PackageManagementEvents packageManagementEvents,
			FakeLogger logger)
			: base (
				parent,
				package,
				selectedProjects,
				packageManagementEvents,
				null,
				logger)
		{
			this.FakePackage = package;
			this.PackageManagementEvents = packageManagementEvents;
			this.FakeLogger = logger;
		}
        public TestableInstalledPackageViewModel(
			IPackageViewModelParent parent,
			FakePackage package,
			SelectedProjectsForInstalledPackages selectedProjects,
			FakePackageManagementEvents packageManagementEvents,
			FakePackageActionRunner actionRunner,
			FakeLogger logger)
            : base(parent,
				package,
				selectedProjects,
				packageManagementEvents,
				actionRunner,
				logger)
        {
            this.FakePackage = package;
            this.FakeActionRunner = actionRunner;
            this.FakeLogger = logger;
            this.FakePackageManagementEvents = packageManagementEvents;
        }
 public TestableUpdatedPackageViewModel(
     IPackageViewModelParent parent,
     FakePackage package,
     SelectedProjectsForUpdatedPackages selectedProjects,
     FakePackageManagementEvents packageManagementEvents,
     FakePackageActionRunner actionRunner,
     FakeLogger logger)
     : base(
         parent,
         package,
         selectedProjects,
         packageManagementEvents,
         actionRunner,
         logger)
 {
     this.FakePackage                 = package;
     this.FakeActionRunner            = actionRunner;
     this.FakeLogger                  = logger;
     this.FakePackageManagementEvents = packageManagementEvents;
 }
 public virtual PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
 {
     return new PackageViewModel(
         parent,
         package);
 }
 public virtual PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
 {
     return(new PackageViewModel(
                parent,
                package));
 }
Ejemplo n.º 32
0
 public TestableInstalledPackageViewModel(IPackageViewModelParent parent)
     : this(parent, new FakePackageManagementSolution())
 {
 }
		public TestableInstalledPackageViewModel(IPackageViewModelParent parent)
			: this(parent, new FakePackageManagementSolution())
		{
		}