本文整理汇总了C#中MonoDevelop.PackageManagement.Tests.Helpers.FakePackageRepository类的典型用法代码示例。如果您正苦于以下问题:C# FakePackageRepository类的具体用法?C# FakePackageRepository怎么用?C# FakePackageRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FakePackageRepository类属于MonoDevelop.PackageManagement.Tests.Helpers命名空间,在下文中一共展示了FakePackageRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WalkPackage
void WalkPackage (IPackage package)
{
var localRepository = new FakePackageRepository ();
var sourceRepository = new FakePackageRepository ();
var walker = new InstallWalker (localRepository, sourceRepository, null, NullLogger.Instance, true, false, DependencyVersion.Lowest);
walker.Walk (package);
}
示例2: 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 ();
fakePackageOperationResolver = fakePackageOperationResolverFactory.FakeInstallPackageOperationResolver;
var fakeSolutionPackageRepository = new FakeSolutionPackageRepository ();
fakeSolutionPackageRepository.FileSystem = fakeFileSystem;
fakeSolutionPackageRepository.PackagePathResolver = pathResolver;
fakeSolutionPackageRepository.FakeSharedRepository = fakeSolutionSharedRepository;
packageManager = new MonoDevelopPackageManager (fakeFeedSourceRepository,
packageRefRepositoryHelper.FakeProjectSystem,
fakeSolutionPackageRepository,
fakePackageOperationResolverFactory);
}
示例3: CreateRecentPackageRepositoryPassingAggregateRepository
IPackageRepository CreateRecentPackageRepositoryPassingAggregateRepository ()
{
recentPackagesPassedToCreateRecentPackageRepository = new RecentPackageInfo[0];
fakeAggregateRepositoryPassedToCreateRecentPackageRepository = new FakePackageRepository ();
return cache.CreateRecentPackageRepository (
recentPackagesPassedToCreateRecentPackageRepository,
fakeAggregateRepositoryPassedToCreateRecentPackageRepository);
}
示例4: AddPackageReference
public void GetUpdatedPackages_OnePackageReferencedWithConstraintAndUpdatesAvailable_LatestVersionReturnedBasedOnConstraint ()
{
AddPackageReference ("Test", "1.0");
FakePackage package = AddPackageToSourceRepository ("Test", "2.0");
FakePackage [] expectedPackages = new [] {
package
};
AddPackageToSourceRepository ("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;
var repository = new FakePackageRepository ();
repository.FakePackages = sourceRepositoryPackages;
CreateUpdatedPackages (repository);
IEnumerable<IPackage> packages = updatedPackages.GetUpdatedPackages ();
PackageCollectionAssert.AreEqual (expectedPackages, packages);
}
示例5: CreateCacheUsingPackageSources
void CreateCacheUsingPackageSources (ISharpDevelopPackageRepositoryFactory repositoryFactory)
{
nuGetPackageSource = new PackageSource ("http://nuget.org", "NuGet");
machineCache = new FakePackageRepository ();
cache = new PackageRepositoryCache (packageSourcesHelper.Options, machineCache, repositoryFactory);
}
示例6: GetProjects_SolutionHasOneProject_MSBuildProjectUsedToCreateProject
public void GetProjects_SolutionHasOneProject_MSBuildProjectUsedToCreateProject ()
{
CreateSolution ();
FakeDotNetProject expectedProject = AddProjectToOpenProjects ("MyProject");
var repository = new FakePackageRepository ();
solution.GetProjects (repository).ToList ();
IDotNetProject project = fakeProjectFactory.FirstProjectPassedToCreateProject;
Assert.AreEqual (expectedProject, project);
}
示例7: 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);
}
示例8: CreatePackage
void CreatePackage ()
{
package = new TestablePackageFromRepository ();
fakePackage = package.FakePackagePassedToConstructor;
fakeRepository = package.FakePackageRepositoryPassedToConstructor;
}
示例9: GetActiveProject_RepositoryPassedWhenSolutionOpenButNoProjectSelected_ReturnsNull
public void GetActiveProject_RepositoryPassedWhenSolutionOpenButNoProjectSelected_ReturnsNull ()
{
CreateSolution ();
fakeProjectService.CurrentProject = null;
var repository = new FakePackageRepository ();
IPackageManagementProject activeProject = solution.GetActiveProject (repository);
Assert.IsNull (activeProject);
}
示例10: FakeProjectManager
public FakeProjectManager ()
{
LocalRepository = new FakePackageRepository ();
SourceRepository = new FakePackageRepository ();
}
示例11: GetActiveProject_RepositoryPassed_ReturnsProjectFromProjectFactory
public void GetActiveProject_RepositoryPassed_ReturnsProjectFromProjectFactory ()
{
CreateSolution ();
var expectedRepository = new FakePackageRepository ();
IPackageManagementProject project = solution.GetActiveProject (expectedRepository);
FakePackageManagementProject expectedProject = fakeProjectFactory.FirstFakeProjectCreated;
Assert.AreEqual (expectedProject, project);
}
示例12: CreateUpdateAllPackagesInSolution
void CreateUpdateAllPackagesInSolution ()
{
fakeSolution = new FakePackageManagementSolution ();
fakeSourceRepository = new FakePackageRepository ();
updateAllPackagesInSolution = new UpdateAllPackagesInSolution (fakeSolution, fakeSourceRepository);
}
示例13: CreateNewActiveRepositoryWithDifferentPackages
void CreateNewActiveRepositoryWithDifferentPackages ()
{
var package = new FakePackage ("NewRepositoryPackageId");
var newRepository = new FakePackageRepository ();
newRepository.FakePackages.Add (package);
registeredPackageRepositories.FakeActiveRepository = newRepository;
}
示例14: AddRepository
FakePackageRepository AddRepository ()
{
var repository = new FakePackageRepository ();
repositories.Add (repository);
return repository;
}
示例15: TestablePackageFromRepository
public TestablePackageFromRepository (FakePackage package, FakePackageRepository repository)
: base (package, repository)
{
this.FakePackagePassedToConstructor = package;
this.FakePackageRepositoryPassedToConstructor = repository;
}