コード例 #1
0
 void AddTwoProjects()
 {
     var project = new FakeSelectedProject("Test1");
     fakeSelectedProjects.Add(project);
     project = new FakeSelectedProject("Test2");
     fakeSelectedProjects.Add(project);
 }
コード例 #2
0
		public void GetProjects_SolutionHasTwoProjectsAndOneProjectSelectedInProjectsBrowserAndPackageIsInstalledInProject_ReturnsProjectAndIsSelectedIsTrue()
		{
			CreateFakeSolution();
			List<IProject> projectsAddedToSolution = AddSolutionWithTwoProjectsToProjectService();
			projectsAddedToSolution[0].Name = "Aaa";
			IProject msbuildProject = projectsAddedToSolution[1];
			msbuildProject.Name = "MyProject";
			fakeSolution.FakeActiveMSBuildProject = msbuildProject;
			
			var fakePackage = new FakePackage();
			var fakeProject = fakeSolution.AddFakeProjectToReturnFromGetProject("MyProject");
			fakeProject.FakePackages.Add(fakePackage);
			fakeSolution.AddFakeProjectToReturnFromGetProject("Aaa");

			CreateSelectedProjects();
			
			List<IPackageManagementSelectedProject> projects =
				selectedProjects.GetProjects(fakePackage).ToList();
			
			var expectedProject = new FakeSelectedProject("MyProject", selected: true);
			var expectedProjects = new List<IPackageManagementSelectedProject>();
			expectedProjects.Add(expectedProject);
			
			SelectedProjectCollectionAssert.AreEqual(expectedProjects, projects);
			Assert.AreEqual(fakePackage.FakePackageRepository, fakeSolution.RepositoryPassedToGetProject);
			Assert.AreEqual(msbuildProject, fakeSolution.ProjectPassedToGetProject);
		}
コード例 #3
0
		void AddProject(string name, bool selected)
		{
			var project = new FakeSelectedProject() {
				Name = name,
				IsSelected = selected
			};
			Projects.Add(project);
		}
        void AddProject(string name, bool selected)
        {
            var project = new FakeSelectedProject()
            {
                Name       = name,
                IsSelected = selected
            };

            Projects.Add(project);
        }
コード例 #5
0
		public void GetProjects_SolutionHasTwoProjectsAndOneProjectSelectedInProjectsBrowser_ReturnsProjectSelectedInProjects()
		{
			CreateFakeSolution();
			List<IProject> projectsAddedToSolution = AddSolutionWithTwoProjectsToProjectService();
			IProject project = projectsAddedToSolution[1];
			project.Name = "MyProject";
			fakeSolution.FakeActiveMSBuildProject = project;
			
			var fakeProject = fakeSolution.AddFakeProjectToReturnFromGetProject("MyProject");
			CreateSelectedProjects();
			
			var fakePackage = new FakePackage();
			var projects = new List<IPackageManagementSelectedProject>();
			projects.AddRange(selectedProjects.GetProjects(fakePackage));
			
			var expectedProject = new FakeSelectedProject("MyProject", selected: false, enabled: true);
			var expectedProjects = new List<IPackageManagementSelectedProject>();
			expectedProjects.Add(expectedProject);
			
			SelectedProjectCollectionAssert.AreEqual(expectedProjects, projects);
		}
コード例 #6
0
		FakePackageOperation AddFakeUninstallPackageOperationWithPackageThatRequiresLicenseAcceptance(FakeSelectedProject selectedProject)
		{
			FakePackageOperation uninstallOperation = selectedProject.AddFakeUninstallPackageOperation();
			uninstallOperation.FakePackage.RequireLicenseAcceptance = true;
			return uninstallOperation;
		}
コード例 #7
0
		FakePackageOperation AddFakeInstallPackageOperationWithPackage(FakeSelectedProject selectedProject, bool requireLicenseAcceptance)
		{
			FakePackageOperation operation = selectedProject.AddFakeInstallPackageOperation();
			operation.FakePackage.RequireLicenseAcceptance = requireLicenseAcceptance;
			return operation;
		}
コード例 #8
0
		FakePackageOperation AddFakeInstallPackageOperationWithPackageThatDoesNotRequireLicenseAcceptance(FakeSelectedProject selectedProject)
		{
			return AddFakeInstallPackageOperationWithPackage(selectedProject, requireLicenseAcceptance: false);
		}