本文整理汇总了C#中ICSharpCode.PackageManagement.Design.FakePackageRepository类的典型用法代码示例。如果您正苦于以下问题:C# FakePackageRepository类的具体用法?C# FakePackageRepository怎么用?C# FakePackageRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FakePackageRepository类属于ICSharpCode.PackageManagement.Design命名空间,在下文中一共展示了FakePackageRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:25,代码来源:SharpDevelopPackageManagerTests.cs
示例2: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages()
{
var package = new FakePackage("NewRepositoryPackageId");
var newRepository = new FakePackageRepository();
newRepository.FakePackages.Add(package);
registeredPackageRepositories.FakeActiveRepository = newRepository;
}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:7,代码来源:AvailablePackagesViewModelTests.cs
示例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);
}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:7,代码来源:UpdatePackageInAllProjectsTests.cs
示例4: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages()
{
var package = new FakePackage("NewRepositoryPackageId");
var newRepository = new FakePackageRepository();
newRepository.FakePackages.Add(package);
packageManagementService.FakeActivePackageRepository = newRepository;
}
开发者ID:kleinux,项目名称:SharpDevelop,代码行数:7,代码来源:AvailablePackagesViewModelTests.cs
示例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;
}
开发者ID:kristjan84,项目名称:SharpDevelop,代码行数:8,代码来源:ProjectTemplatePackageRepositoryCacheTests.cs
示例6: CreateRecentPackageRepositoryPassingAggregateRepository
IPackageRepository CreateRecentPackageRepositoryPassingAggregateRepository()
{
recentPackagesPassedToCreateRecentPackageRepository = new RecentPackageInfo[0];
fakeAggregateRepositoryPassedToCreateRecentPackageRepository = new FakePackageRepository();
return cache.CreateRecentPackageRepository(
recentPackagesPassedToCreateRecentPackageRepository,
fakeAggregateRepositoryPassedToCreateRecentPackageRepository);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:9,代码来源:PackageRepositoryCacheTests.cs
示例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);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:13,代码来源:PackageRepositoryCacheTests.cs
示例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);
}
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:14,代码来源:PackageManagementSelectedProjectsTests.cs
示例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);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:14,代码来源:PackageRepositoryCacheTests.cs
示例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);
}
开发者ID:wesnerm,项目名称:SharpDevelop,代码行数:14,代码来源:PackageManagementProjectTests.cs
示例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);
}
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:15,代码来源:PackageManagementProjectTests.cs
示例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);
}
开发者ID:dsrbecky,项目名称:SharpDevelop,代码行数:19,代码来源:SharpDevelopPackageManagerTests.cs
示例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);
}
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:22,代码来源:PackageManagementSelectedProjectsTests.cs
示例14: CreateUpdateAllPackagesInSolution
void CreateUpdateAllPackagesInSolution()
{
fakeSolution = new FakePackageManagementSolution();
fakeSourceRepository = new FakePackageRepository();
updateAllPackagesInSolution = new UpdateAllPackagesInSolution(fakeSolution, fakeSourceRepository);
}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:6,代码来源:UpdateAllPackagesInSolutionTests.cs
示例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);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:11,代码来源:PackageManagementSolutionTests.cs
示例16: FakeProjectManager
public FakeProjectManager()
{
LocalRepository = new FakePackageRepository();
SourceRepository = new FakePackageRepository();
}
开发者ID:kristjan84,项目名称:SharpDevelop,代码行数:5,代码来源:FakeProjectManager.cs
示例17: CreateProject
public void GetUpdatedPackages_OnePackageReferencedWithConstraintAndUpdatesAvailable_LatestVersionReturnedBasedOnConstraint()
{
CreateProject();
project.FakePackages.Add(new FakePackage("Test", "1.0"));
var sourceRepository = new FakePackageRepository();
FakePackage packageVersion2 = sourceRepository.AddFakePackageWithVersion("Test", "2.0");
FakePackage [] expectedPackages = new [] {
packageVersion2
};
sourceRepository.AddFakePackageWithVersion("Test", "3.0");
var versionSpec = new VersionSpec();
versionSpec.MinVersion = new SemanticVersion("1.0");
versionSpec.IsMinInclusive = true;
versionSpec.MaxVersion = new SemanticVersion("2.0");
versionSpec.IsMaxInclusive = true;
var constraintProvider = new DefaultConstraintProvider();
constraintProvider.AddConstraint("Test", versionSpec);
project.ConstraintProvider = constraintProvider;
CreateUpdatedPackages(sourceRepository);
IEnumerable<IPackage> packages = updatedPackages.GetUpdatedPackages();
PackageCollectionAssert.AreEqual(expectedPackages, packages);
}
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:24,代码来源:UpdatedPackagesTests.cs
示例18: CreatePackage
void CreatePackage()
{
package = new TestablePackageFromRepository();
fakePackage = package.FakePackagePassedToConstructor;
fakeRepository = package.FakePackageRepositoryPassedToConstructor;
}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:6,代码来源:PackageFromRepositoryTests.cs
示例19: GetProjects_SolutionHasOneProject_RepositoryUsedToCreateProject
public void GetProjects_SolutionHasOneProject_RepositoryUsedToCreateProject()
{
CreateSolution();
AddProjectToOpenProjects("MyProject");
var expectedRepository = new FakePackageRepository();
List<IPackageManagementProject> projects = solution.GetProjects(expectedRepository).ToList();
IPackageRepository repository = fakeProjectFactory.FirstRepositoryPassedToCreateProject;
Assert.AreEqual(expectedRepository, repository);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:11,代码来源:PackageManagementSolutionTests.cs
示例20: GetProjects_SolutionHasTwoProjects_ReturnsTwoProjects
public void GetProjects_SolutionHasTwoProjects_ReturnsTwoProjects()
{
CreateSolution();
AddProjectToOpenProjects("One");
AddProjectToOpenProjects("Two");
var repository = new FakePackageRepository();
List<IPackageManagementProject> projects = solution.GetProjects(repository).ToList();
Assert.AreEqual(2, projects.Count);
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:10,代码来源:PackageManagementSolutionTests.cs
注:本文中的ICSharpCode.PackageManagement.Design.FakePackageRepository类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论