コード例 #1
0
 FakePackageManagementProject AddProjectToSolution()
 {
     return(solution.AddFakeProject("MyProject"));
 }
コード例 #2
0
 FakePackageManagementProject CreateSolutionWithOneProject()
 {
     CreateSolution();
     return(solution.AddFakeProject("MyProject"));
 }
コード例 #3
0
 FakePackageManagementProject AddProjectToSolution(string projectName)
 {
     return(fakeSolution.AddFakeProject(projectName));
 }
コード例 #4
0
        public void ProcessRecord_ReinstallPackageInAllProjectsWhenThreeProjectsButOnlyTwoHavePackage_PackageIsReinstalledInProjects()
        {
            CreateCmdletWithActivePackageSourceAndProject();
            AddPackageSourceToConsoleHost();
            SetSourceParameter("Test");
            SetIdParameter("B");
            cmdlet.Reinstall          = true;
            cmdlet.IgnoreDependencies = false;
            FakePackageManagementProject project1 = fakeSolution.AddFakeProject("Project1");
            FakePackageManagementProject project2 = fakeSolution.AddFakeProject("Project2");
            FakePackageManagementProject project3 = fakeSolution.AddFakeProject("Project3");

            ProjectHasPackageInstalled(project1, "A", "1.1");
            ProjectHasPackageInstalled(project1, "B", "1.2");
            ProjectHasPackageInstalled(project3, "A", "1.1");
            ProjectHasPackageInstalled(project3, "B", "1.3");

            RunCmdlet();

            FakeReinstallPackageAction project1ReinstallAction = project1.FakeReinstallPackageActionsCreated.Single();
            FakeReinstallPackageAction project3ReinstallAction = project3.FakeReinstallPackageActionsCreated.Single();

            Assert.AreEqual(0, project2.FakeReinstallPackageActionsCreated.Count);
            Assert.IsTrue(project1ReinstallAction.IsExecuted);
            Assert.IsTrue(project3ReinstallAction.IsExecuted);
            Assert.AreEqual(project1, project1ReinstallAction.Project);
            Assert.AreEqual(project3, project3ReinstallAction.Project);
            Assert.AreEqual(cmdlet, project1ReinstallAction.PackageScriptRunner);
            Assert.AreEqual(cmdlet, project3ReinstallAction.PackageScriptRunner);
            Assert.AreEqual("B", project1ReinstallAction.PackageId);
            Assert.AreEqual("B", project3ReinstallAction.PackageId);
            Assert.AreEqual("1.2", project1ReinstallAction.PackageVersion.ToString());
            Assert.AreEqual("1.3", project3ReinstallAction.PackageVersion.ToString());
            Assert.IsFalse(project1ReinstallAction.AllowPrereleaseVersions);
            Assert.IsFalse(project3ReinstallAction.AllowPrereleaseVersions);
            Assert.IsTrue(project1ReinstallAction.UpdateDependencies);
            Assert.IsTrue(project3ReinstallAction.UpdateDependencies);
            Assert.AreEqual("Test", fakeConsoleHost.PackageSourcePassedToGetActivePackageSource);
            Assert.AreEqual(fakeConsoleHost.FakePackageRepository, fakeSolution.SourceRepositoryPassedToGetProjects);
        }