本文整理汇总了C#中ICSharpCode.PackageManagement.Design.FakePackage类的典型用法代码示例。如果您正苦于以下问题:C# FakePackage类的具体用法?C# FakePackage怎么用?C# FakePackage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FakePackage类属于ICSharpCode.PackageManagement.Design命名空间,在下文中一共展示了FakePackage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateInstallOperationWithFile
public static PackageOperation CreateInstallOperationWithFile(string fileName)
{
var package = new FakePackage();
package.AddFile(fileName);
return new PackageOperation(package, PackageAction.Install);
}
示例2: TestablePackageViewModel
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;
};
}
示例3: CreateFakeSolution
public void GetProjects_SolutionHasTwoProjectsAndNoProjectSelectedInProjectsBrowserAndPackageIsInstalledInFirstProject_ReturnsAllProjectsInSolutionWithIsSelectedIsTrue()
{
CreateFakeSolution();
List<IProject> projectsAddedToSolution = AddSolutionWithTwoProjectsToProjectService();
projectsAddedToSolution[0].Name = "Project A";
projectsAddedToSolution[1].Name = "Project B";
fakeSolution.FakeActiveProject = null;
var fakePackage = new FakePackage("Test");
var fakeProject = fakeSolution.AddFakeProjectToReturnFromGetProject("Project A");
fakeProject.FakePackages.Add(fakePackage);
fakeSolution.AddFakeProjectToReturnFromGetProject("Project B");
CreateSelectedProjects();
List<IPackageManagementSelectedProject> projects =
selectedProjects.GetProjects(fakePackage).ToList();
var expectedProjects = new List<IPackageManagementSelectedProject>();
expectedProjects.Add(new FakeSelectedProject("Project A", selected: true));
expectedProjects.Add(new FakeSelectedProject("Project B", selected: false));
SelectedProjectCollectionAssert.AreEqual(expectedProjects, projects);
Assert.AreEqual(fakePackage.FakePackageRepository, fakeSolution.RepositoryPassedToGetProject);
Assert.AreEqual(projectsAddedToSolution, fakeSolution.ProjectsPassedToGetProject);
}
示例4: AddFileToPackageBeingUninstalled
void AddFileToPackageBeingUninstalled(string fileName)
{
var package = new FakePackage();
package.AddFile(fileName);
action.Package = package;
}
示例5: AddPackageInstallOperation
public FakePackage AddPackageInstallOperation()
{
var package = new FakePackage("Package to install");
var operation = new PackageOperation(package, PackageAction.Install);
PackageOperations.Add(operation);
return package;
}
示例6: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages()
{
var package = new FakePackage("NewRepositoryPackageId");
var newRepository = new FakePackageRepository();
newRepository.FakePackages.Add(package);
packageManagementService.FakeActivePackageRepository = newRepository;
}
示例7: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages()
{
var package = new FakePackage("NewRepositoryPackageId");
var newRepository = new FakePackageRepository();
newRepository.FakePackages.Add(package);
registeredPackageRepositories.FakeActiveRepository = newRepository;
}
示例8: AddOneFakeUninstallPackageOperation
public PackageOperation AddOneFakeUninstallPackageOperation()
{
var package = new FakePackage("PackageToUninstall");
var operation = new PackageOperation(package, PackageAction.Uninstall);
FakeSolution.FakeActiveProject.FakeInstallOperations.Add(operation);
return operation;
}
示例9: CreateScript
void CreateScript()
{
fakeScriptFileName = new FakePackageScriptFileName();
fakeSession = new FakePackageScriptSession();
fakePackage = new FakePackage();
script = new PackageInitializeScript(fakePackage, fakeScriptFileName);
}
示例10: CreateFakePackage
FakePackage CreateFakePackage()
{
var package = new FakePackage();
package.Id = "Test";
package.Version = new Version(1, 0, 0, 0);
return package;
}
示例11: CreateFakeSolution
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);
}
示例12: AddPackage
IPackage AddPackage(string id, string version, string installPath)
{
var package = new FakePackage(id, version);
installedPackages.Add(package);
fakeSolution.Stub(s => s.GetInstallPath(package)).Return(installPath);
return package;
}
示例13: AddPackageToRecentPackageRepository
FakePackage AddPackageToRecentPackageRepository()
{
var package = new FakePackage("Test");
FakePackageRepository repository = registeredPackageRepositories.FakeRecentPackageRepository;
repository.FakePackages.Add(package);
return package;
}
示例14: CreateViewModel
void CreateViewModel()
{
viewModel = new TestableInstalledPackageViewModel();
fakeSolution = viewModel.FakeSolution;
fakeActionRunner = viewModel.FakeActionRunner;
fakePackage = viewModel.FakePackage;
fakePackageManagementEvents = viewModel.FakePackageManagementEvents;
}
示例15: AddPackageReference
public override void AddPackageReference(string packageId, Version version, bool ignoreDependencies)
{
var package = new FakePackage();
package.Id = packageId;
package.Version = version;
PackagePassedToAddPackageReference = package;
IgnoreDependenciesPassedToAddPackageReference = ignoreDependencies;
}