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 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;
		}
Beispiel #3
0
 TestableSharpDevelopProjectSystem(
     MSBuildBasedProject project,
     IPackageManagementFileService fileService,
     IPackageManagementProjectService projectService,
     FakeLogger logger)
     : base(project, fileService, projectService)
 {
     FakeFileService    = (FakeFileService)fileService;
     FakeProjectService = (FakePackageManagementProjectService)projectService;
     Logger             = logger;
 }
		TestableSharpDevelopProjectSystem(
			MSBuildBasedProject project,
			IPackageManagementFileService fileService,
			IPackageManagementProjectService projectService,
			FakeLogger logger)
			: base(project, fileService, projectService)
		{
			FakeFileService = (FakeFileService)fileService;
			FakeProjectService = (FakePackageManagementProjectService)projectService;
			Logger = logger;
		}
		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 TestableUpdatedPackageViewModel(
     FakePackage package,
     SelectedProjectsForUpdatedPackages selectedProjects,
     FakePackageManagementEvents packageManagementEvents,
     FakePackageActionRunner actionRunner,
     FakeLogger logger)
     : base(
         package,
         selectedProjects,
         packageManagementEvents,
         actionRunner,
         logger)
 {
     this.FakePackage                 = package;
     this.FakeActionRunner            = actionRunner;
     this.FakeLogger                  = logger;
     this.FakePackageManagementEvents = packageManagementEvents;
 }
		public TestableInstalledPackageViewModel(
			FakePackage package,
			SelectedProjectsForInstalledPackages selectedProjects,
			FakePackageManagementEvents packageManagementEvents,
			FakePackageActionRunner actionRunner,
			FakeLogger logger)
			: base(
				package,
				selectedProjects,
				packageManagementEvents,
				actionRunner,
				logger)
		{
			this.FakePackage = package;
			this.FakeActionRunner = actionRunner;
			this.FakeLogger = logger;
			this.FakePackageManagementEvents = packageManagementEvents;
		}
		public TestableUpdatedPackageViewModel(
			FakePackage package,
			FakePackageManagementSolution solution,
			FakePackageManagementEvents packageManagementEvents,
			FakePackageActionRunner actionRunner,
			FakeLogger logger)
			: base(
				package,
				solution,
				packageManagementEvents,
				actionRunner,
				logger)
		{
			this.FakePackage = package;
			this.FakeSolution = solution;
			this.FakeActionRunner = actionRunner;
			this.FakeLogger = logger;
		}
 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;
 }
		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;
		}
        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;

            IsProjectPackageReturnsValue = true;
            IsProjectPackageIsCalled     = false;
        }
		public void Logger_SetLogger_LoggerOnPackageManagerIsSet()
		{
			CreateProject();
			var expectedLogger = new FakeLogger();
			
			project.Logger = expectedLogger;
			
			Assert.AreEqual(expectedLogger, fakePackageManager.Logger);
		}