本文整理汇总了C#中ICSharpCode.PackageManagement.Design.FakePackageRepository类的典型用法代码示例。如果您正苦于以下问题:C# FakePackageRepository类的具体用法?C# FakePackageRepository怎么用?C# FakePackageRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FakePackageRepository类属于ICSharpCode.PackageManagement.Design命名空间,在下文中一共展示了FakePackageRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePackageManager
void CreatePackageManager(IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
{
options = new TestablePackageManagementOptions();
options.PackagesDirectory = "packages";
repositoryPaths = new SolutionPackageRepositoryPath(project, options);
var pathResolver = new DefaultPackagePathResolver(repositoryPaths.PackageRepositoryPath);
fakeFileSystem = new FakeFileSystem();
fakeFeedSourceRepository = new FakePackageRepository();
fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;
fakePackageOperationResolverFactory = new FakePackageOperationResolverFactory();
var fakeSolutionPackageRepository = new FakeSolutionPackageRepository();
fakeSolutionPackageRepository.FileSystem = fakeFileSystem;
fakeSolutionPackageRepository.PackagePathResolver = pathResolver;
fakeSolutionPackageRepository.FakeSharedRepository = fakeSolutionSharedRepository;
packageManager = new SharpDevelopPackageManager(fakeFeedSourceRepository,
packageRefRepositoryHelper.FakeProjectSystem,
fakeSolutionPackageRepository,
fakePackageOperationResolverFactory);
}
示例2: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages()
{
var package = new FakePackage("NewRepositoryPackageId");
var newRepository = new FakePackageRepository();
newRepository.FakePackages.Add(package);
registeredPackageRepositories.FakeActiveRepository = newRepository;
}
示例3: CreateUpdatePackageInAllProjects
void CreateUpdatePackageInAllProjects(string packageId, SemanticVersion version)
{
fakeSolution = new FakePackageManagementSolution();
fakeSourceRepository = new FakePackageRepository();
var packageReference = new PackageReference(packageId, version, null, null, false, false);
updatePackageInAllProjects = new UpdatePackageInAllProjects(packageReference, fakeSolution, fakeSourceRepository);
}
示例4: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages()
{
var package = new FakePackage("NewRepositoryPackageId");
var newRepository = new FakePackageRepository();
newRepository.FakePackages.Add(package);
packageManagementService.FakeActivePackageRepository = newRepository;
}
示例5: AddRegisteredPackageRepository
FakePackageRepository AddRegisteredPackageRepository(string packageSourceUrl, string packageSourceName)
{
var packageSource = new PackageSource(packageSourceUrl, packageSourceName);
AddRegisteredPackageSource(packageSource);
FakePackageRepository fakeRepository = new FakePackageRepository();
fakeMainCache.FakePackageRepositories.Add(packageSource.Source, fakeRepository);
return fakeRepository;
}
示例6: CreateRecentPackageRepositoryPassingAggregateRepository
IPackageRepository CreateRecentPackageRepositoryPassingAggregateRepository()
{
recentPackagesPassedToCreateRecentPackageRepository = new RecentPackageInfo[0];
fakeAggregateRepositoryPassedToCreateRecentPackageRepository = new FakePackageRepository();
return cache.CreateRecentPackageRepository(
recentPackagesPassedToCreateRecentPackageRepository,
fakeAggregateRepositoryPassedToCreateRecentPackageRepository);
}
示例7: CreateAggregatePackageRepository_OnePackageRepositoryPassed_ReturnsAggregateRepositoryFromFactory
public void CreateAggregatePackageRepository_OnePackageRepositoryPassed_ReturnsAggregateRepositoryFromFactory()
{
CreateCache();
var repositories = new FakePackageRepository[] {
new FakePackageRepository()
};
IPackageRepository aggregateRepository = cache.CreateAggregateRepository(repositories);
FakePackageRepository expectedRepository = fakePackageRepositoryFactory.FakeAggregateRepository;
Assert.AreEqual(expectedRepository, aggregateRepository);
}
示例8: GetInstalledPackages_PackageInstalledInProjectAndProjectIsSelected_CreatesProjectUsingRepository
public void GetInstalledPackages_PackageInstalledInProjectAndProjectIsSelected_CreatesProjectUsingRepository()
{
CreateFakeSolution();
List<IProject> projectsAddedToSolution = AddSolutionWithTwoProjectsToProjectService();
fakeSolution.FakeActiveMSBuildProject = projectsAddedToSolution[0];
CreateSelectedProjects();
var expectedRepository = new FakePackageRepository();
IQueryable<IPackage> packages = selectedProjects.GetPackages(expectedRepository);
IPackageRepository repository = fakeSolution.RepositoryPassedToGetProject;
Assert.AreEqual(expectedRepository, repository);
}
示例9: CreateAggregatePackageRepository_OnePackageRepositoryPassed_RepositoryUsedToCreateAggregateRepository
public void CreateAggregatePackageRepository_OnePackageRepositoryPassed_RepositoryUsedToCreateAggregateRepository()
{
CreateCache();
var repositories = new FakePackageRepository[] {
new FakePackageRepository()
};
cache.CreateAggregateRepository(repositories);
IEnumerable<IPackageRepository> repositoriesUsedToCreateAggregateRepository =
fakePackageRepositoryFactory.RepositoriesPassedToCreateAggregateRepository;
Assert.AreEqual(repositories, repositoriesUsedToCreateAggregateRepository);
}
示例10: CreateProject
void CreateProject(MSBuildBasedProject msbuildProject)
{
fakePackageManagerFactory = new FakePackageManagerFactory();
fakePackageManager = fakePackageManagerFactory.FakePackageManager;
fakeProjectManager = fakePackageManager.FakeProjectManager;
fakeSourceRepository = new FakePackageRepository();
fakePackageManagementEvents = new FakePackageManagementEvents();
project = new PackageManagementProject(
fakeSourceRepository,
msbuildProject,
fakePackageManagementEvents,
fakePackageManagerFactory);
}
示例11: CreateProject
void CreateProject()
{
fakePackageManagerFactory = new FakePackageManagerFactory();
fakePackageManager = fakePackageManagerFactory.FakePackageManager;
fakeProjectManager = fakePackageManager.FakeProjectManager;
fakeSourceRepository = new FakePackageRepository();
fakeMSBuildProject = ProjectHelper.CreateTestProject();
fakePackageManagementEvents = new FakePackageManagementEvents();
project = new PackageManagementProject(
fakeSourceRepository,
fakeMSBuildProject,
fakePackageManagementEvents,
fakePackageManagerFactory);
}
示例12: CreatePackageManager
void CreatePackageManager(IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
{
options = new PackageManagementOptions(new Properties());
options.PackagesDirectory = "packages";
repositoryPaths = new PackageRepositoryPaths(project, options);
var pathResolver = new DefaultPackagePathResolver(repositoryPaths.SolutionPackagesPath);
fakeFileSystem = new FakeFileSystem();
fakeFeedSourceRepository = new FakePackageRepository();
fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;
packageManager = new SharpDevelopPackageManager(fakeFeedSourceRepository,
packageRefRepositoryHelper.FakeProjectSystem,
fakeFileSystem,
fakeSolutionSharedRepository,
pathResolver);
}
示例13: GetInstalledPackages_PackageInstalledInProjectAndProjectIsSelected_ReturnsPackageInstalledInProject
public void GetInstalledPackages_PackageInstalledInProjectAndProjectIsSelected_ReturnsPackageInstalledInProject()
{
CreateFakeSolution();
List<IProject> projectsAddedToSolution = AddSolutionWithTwoProjectsToProjectService();
fakeSolution.FakeActiveMSBuildProject = projectsAddedToSolution[0];
fakeSolution.FakeActiveMSBuildProject.Name = "MyProject";
var package = new FakePackage("Test");
var project = new FakePackageManagementProject("MyProject");
project.FakePackages.Add(package);
fakeSolution.FakeProjectsToReturnFromGetProject.Add("MyProject", project);
CreateSelectedProjects();
var repository = new FakePackageRepository();
IQueryable<IPackage> packages = selectedProjects.GetPackages(repository);
var expectedPackages = new FakePackage[] {
package
};
PackageCollectionAssert.AreEqual(expectedPackages, packages);
}
示例14: CreateUpdateAllPackagesInSolution
void CreateUpdateAllPackagesInSolution()
{
fakeSolution = new FakePackageManagementSolution();
fakeSourceRepository = new FakePackageRepository();
updateAllPackagesInSolution = new UpdateAllPackagesInSolution(fakeSolution, fakeSourceRepository);
}
示例15: GetProjects_SolutionHasOneProject_MSBuildProjectUsedToCreateProject
public void GetProjects_SolutionHasOneProject_MSBuildProjectUsedToCreateProject()
{
CreateSolution();
TestableProject expectedProject = AddProjectToOpenProjects("MyProject");
var repository = new FakePackageRepository();
List<IPackageManagementProject> projects = solution.GetProjects(repository).ToList();
MSBuildBasedProject project = fakeProjectFactory.FirstProjectPassedToCreateProject;
Assert.AreEqual(expectedProject, project);
}