當前位置: 首頁>>代碼示例>>C#>>正文


C# Helpers.FakePackage類代碼示例

本文整理匯總了C#中MonoDevelop.PackageManagement.Tests.Helpers.FakePackage的典型用法代碼示例。如果您正苦於以下問題:C# FakePackage類的具體用法?C# FakePackage怎麽用?C# FakePackage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FakePackage類屬於MonoDevelop.PackageManagement.Tests.Helpers命名空間,在下文中一共展示了FakePackage類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateInstallOperationWithFile

		public static PackageOperation CreateInstallOperationWithFile (string fileName)
		{
			var package = new FakePackage ();
			package.AddFile (fileName);

			return new PackageOperation (package, PackageAction.Install);
		}
開發者ID:FreeBSD-DotNet,項目名稱:monodevelop,代碼行數:7,代碼來源:PackageOperationHelper.cs

示例2: CreatePackageFilesWithTwoFiles

		void CreatePackageFilesWithTwoFiles (string fileName1, string fileName2)
		{
			var package = new FakePackage ();
			package.AddFile (fileName1);
			package.AddFile (fileName2);
			CreatePackageFiles (package);
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:7,代碼來源:PackageFilesTests.cs

示例3: AddOneFakeUninstallPackageOperation

		public PackageOperation AddOneFakeUninstallPackageOperation ()
		{
			var package = new FakePackage ("PackageToUninstall");
			var operation = new FakePackageOperation (package, PackageAction.Uninstall);
			FakeSolution.FakeProjectToReturnFromGetProject.FakeInstallOperations.Add (operation);
			return operation;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:7,代碼來源:TestablePackageViewModel.cs

示例4: AddPackageInstallOperation

		public FakePackage AddPackageInstallOperation ()
		{
			var package = new FakePackage ("Package to install");
			var operation = new PackageOperation (package, PackageAction.Install);
			PackageOperations.Add (operation);
			return package;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:7,代碼來源:InstallPackageHelper.cs

示例5: AddFileToPackageBeingUninstalled

		void AddFileToPackageBeingUninstalled (string fileName)
		{
			var package = new FakePackage ();
			package.AddFile (fileName);

			action.Package = package;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:7,代碼來源:UninstallPackageActionTests.cs

示例6: PackageWithMSBuildTargetsIsRestored

		void PackageWithMSBuildTargetsIsRestored ()
		{
			var package = new FakePackage ("MyPackage");
			package.AddFile (@"build\MyPackage.targets");

			packageEvents.OnPackageRestored (package);
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:7,代碼來源:MSBuildTargetsRestoredMonitorTests.cs

示例7: AddPackageReference

		public override void AddPackageReference (string packageId, SemanticVersion version, bool ignoreDependencies, bool allowPrereleaseVersions)
		{
			var package = new FakePackage ();
			package.Id = packageId;
			package.Version = version;
			PackagePassedToAddPackageReference = package;
			IgnoreDependenciesPassedToAddPackageReference = ignoreDependencies;
			AllowPrereleaseVersionsPassedToAddPackageReference = allowPrereleaseVersions;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:9,代碼來源:TestableProjectManager.cs

示例8: CreateRepositoryWithOneRecentPackageSavedInOptions

		FakePackage CreateRepositoryWithOneRecentPackageSavedInOptions ()
		{
			CreateRecentPackages ();
			var package = new FakePackage ("Test");
			aggregateRepository.FakePackages.Add (package);
			recentPackages.Add (new RecentPackageInfo (package));
			CreateRepository (recentPackages);
			return package;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:9,代碼來源:RecentPackageRepositoryTests.cs

示例9: CreateViewModel

		void CreateViewModel (FakePackageManagementSolution solution)
		{
			viewModelParent = CreateViewModelParent ();
			viewModel = new TestablePackageViewModel (viewModelParent, solution);
			fakePackage = viewModel.FakePackage;
			this.fakeSolution = solution;
			packageManagementEvents = viewModel.PackageManagementEvents;
			fakeLogger = viewModel.FakeLogger;
			fakeUninstallPackageAction = solution.FakeProjectToReturnFromGetProject.FakeUninstallPackageAction;
		}
開發者ID:alexrp,項目名稱:monodevelop,代碼行數:10,代碼來源:PackageViewModelTests.cs

示例10: AddInstallOperationWithFile

		void AddInstallOperationWithFile (string fileName)
		{
			var package = new FakePackage ();
			package.AddFile (fileName);

			var operation = new PackageOperation (package, PackageAction.Install);
			var operations = new List<PackageOperation> ();
			operations.Add (operation);

			action.Operations = operations;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:11,代碼來源:UpdatePackageActionTests.cs

示例11: IsMatch_PackageWithDifferentIdButSameVersionPassed_ReturnsFalse

		public void IsMatch_PackageWithDifferentIdButSameVersionPassed_ReturnsFalse ()
		{
			var version = new SemanticVersion (1, 0, 0, 0);
			var recentPackageInfo = new RecentPackageInfo ("id", version);
			var package = new FakePackage ("different-id");
			package.Version = version;

			bool result = recentPackageInfo.IsMatch (package);

			Assert.IsFalse (result);
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:11,代碼來源:RecentPackageInfoTests.cs

示例12: IsMatch_PackageWithSameIdButDifferentVersionPassed_ReturnsFalse

		public void IsMatch_PackageWithSameIdButDifferentVersionPassed_ReturnsFalse ()
		{
			string id = "id";
			var version = new SemanticVersion (1, 0, 0, 0);
			var recentPackageInfo = new RecentPackageInfo (id, version);
			var package = new FakePackage (id);
			package.Version = new SemanticVersion (2, 0, 0, 0);

			bool result = recentPackageInfo.IsMatch (package);

			Assert.IsFalse (result);
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:12,代碼來源:RecentPackageInfoTests.cs

示例13: Init

		void Init ()
		{
			string config = 
				"<root>\r\n" +
				"    <package id='Test' version='1.0.0.0'/>\r\n" +
				"</root>";

			FakeProjectSystem.FileExistsReturnValue = true;
			FakeProjectSystem.FileToReturnFromOpenFile = config;

			FakePackage package = new FakePackage ("Test", "1.0.0.0");

			FakeSharedSourceRepository.FakePackages.Add (package);
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:14,代碼來源:PackageReferenceRepositoryHelper.cs

示例14: CheckForUpdates_OnePackageUpdated_OneUpdatedPackageFoundForProject

		public void CheckForUpdates_OnePackageUpdated_OneUpdatedPackageFoundForProject ()
		{
			CreateUpdatedPackagesInSolution ();
			FakePackageManagementProject project = AddProjectToSolution ();
			project.AddPackageReference ("MyPackage", "1.0");
			FakePackage updatedPackage = AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.1");
			var expectedPackages = new FakePackage [] { updatedPackage };

			updatedPackagesInSolution.CheckForUpdates ();
			UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);

			Assert.AreEqual (project.Project, updatedPackages.Project);
			Assert.IsNotNull (updatedPackages.Project);
			CollectionAssert.AreEqual (expectedPackages, updatedPackages.GetPackages ());
		}
開發者ID:brantwedel,項目名稱:monodevelop,代碼行數:15,代碼來源:UpdatedPackagesInSolutionTests.cs

示例15: TestablePackageViewModel

		public TestablePackageViewModel (
			IPackageViewModelParent parent,
			FakePackage package,
			PackageManagementSelectedProjects selectedProjects,
			PackageManagementEvents packageManagementEvents,
			FakeLogger logger)
			: base (
				parent,
				package,
				selectedProjects,
				packageManagementEvents,
				null,
				logger)
		{
			this.FakePackage = package;
			this.PackageManagementEvents = packageManagementEvents;
			this.FakeLogger = logger;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:18,代碼來源:TestablePackageViewModel.cs


注:本文中的MonoDevelop.PackageManagement.Tests.Helpers.FakePackage類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。