当前位置: 首页>>代码示例>>C#>>正文


C# Helpers.FakePackageRepository类代码示例

本文整理汇总了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);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:MinClientVersionTests.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:26,代码来源:MonoDevelopPackageManagerTests.cs

示例3: CreateRecentPackageRepositoryPassingAggregateRepository

		IPackageRepository CreateRecentPackageRepositoryPassingAggregateRepository ()
		{
			recentPackagesPassedToCreateRecentPackageRepository = new RecentPackageInfo[0];
			fakeAggregateRepositoryPassedToCreateRecentPackageRepository = new FakePackageRepository ();

			return cache.CreateRecentPackageRepository (
				recentPackagesPassedToCreateRecentPackageRepository,
				fakeAggregateRepositoryPassedToCreateRecentPackageRepository);
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:9,代码来源:PackageRepositoryCacheTests.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:24,代码来源:UpdatedPackagesTests.cs

示例5: CreateCacheUsingPackageSources

		void CreateCacheUsingPackageSources (ISharpDevelopPackageRepositoryFactory repositoryFactory)
		{
			nuGetPackageSource = new PackageSource ("http://nuget.org", "NuGet");
			machineCache = new FakePackageRepository ();
			cache = new PackageRepositoryCache (packageSourcesHelper.Options, machineCache, repositoryFactory);
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:6,代码来源:PackageRepositoryCacheTests.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:11,代码来源:PackageManagementSolutionTests.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:PackageManagementSolutionTests.cs

示例8: CreatePackage

		void CreatePackage ()
		{
			package = new TestablePackageFromRepository ();
			fakePackage = package.FakePackagePassedToConstructor;
			fakeRepository = package.FakePackageRepositoryPassedToConstructor;
		}
开发者ID:nerzhulart,项目名称:monodevelop,代码行数:6,代码来源:PackageFromRepositoryTests.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:PackageManagementSolutionTests.cs

示例10: FakeProjectManager

		public FakeProjectManager ()
		{
			LocalRepository = new FakePackageRepository ();
			SourceRepository = new FakePackageRepository ();
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:5,代码来源:FakeProjectManager.cs

示例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);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:PackageManagementSolutionTests.cs

示例12: CreateUpdateAllPackagesInSolution

		void CreateUpdateAllPackagesInSolution ()
		{
			fakeSolution = new FakePackageManagementSolution ();
			fakeSourceRepository = new FakePackageRepository ();
			updateAllPackagesInSolution = new UpdateAllPackagesInSolution (fakeSolution, fakeSourceRepository);
		}
开发者ID:mafiya69,项目名称:monodevelop,代码行数:6,代码来源:UpdateAllPackagesInSolutionTests.cs

示例13: CreateNewActiveRepositoryWithDifferentPackages

		void CreateNewActiveRepositoryWithDifferentPackages ()
		{
			var package = new FakePackage ("NewRepositoryPackageId");
			var newRepository = new FakePackageRepository ();
			newRepository.FakePackages.Add (package);
			registeredPackageRepositories.FakeActiveRepository = newRepository;
		}
开发者ID:alexrp,项目名称:monodevelop,代码行数:7,代码来源:AvailablePackagesViewModelTests.cs

示例14: AddRepository

		FakePackageRepository AddRepository ()
		{
			var repository = new FakePackageRepository ();
			repositories.Add (repository);
			return repository;
		}
开发者ID:jerriclynsjohn,项目名称:monodevelop,代码行数:6,代码来源:MonoDevelopAggregateRepositoryTests.cs

示例15: TestablePackageFromRepository

		public TestablePackageFromRepository (FakePackage package, FakePackageRepository repository)
			: base (package, repository)
		{
			this.FakePackagePassedToConstructor = package;
			this.FakePackageRepositoryPassedToConstructor = repository;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:6,代码来源:TestablePackageFromRepository.cs


注:本文中的MonoDevelop.PackageManagement.Tests.Helpers.FakePackageRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。