當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。