本文整理汇总了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);
}
示例2: CreatePackageFilesWithTwoFiles
void CreatePackageFilesWithTwoFiles (string fileName1, string fileName2)
{
var package = new FakePackage ();
package.AddFile (fileName1);
package.AddFile (fileName2);
CreatePackageFiles (package);
}
示例3: AddOneFakeUninstallPackageOperation
public PackageOperation AddOneFakeUninstallPackageOperation ()
{
var package = new FakePackage ("PackageToUninstall");
var operation = new FakePackageOperation (package, PackageAction.Uninstall);
FakeSolution.FakeProjectToReturnFromGetProject.FakeInstallOperations.Add (operation);
return operation;
}
示例4: AddPackageInstallOperation
public FakePackage AddPackageInstallOperation ()
{
var package = new FakePackage ("Package to install");
var operation = new PackageOperation (package, PackageAction.Install);
PackageOperations.Add (operation);
return package;
}
示例5: AddFileToPackageBeingUninstalled
void AddFileToPackageBeingUninstalled (string fileName)
{
var package = new FakePackage ();
package.AddFile (fileName);
action.Package = package;
}
示例6: PackageWithMSBuildTargetsIsRestored
void PackageWithMSBuildTargetsIsRestored ()
{
var package = new FakePackage ("MyPackage");
package.AddFile (@"build\MyPackage.targets");
packageEvents.OnPackageRestored (package);
}
示例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;
}
示例8: CreateRepositoryWithOneRecentPackageSavedInOptions
FakePackage CreateRepositoryWithOneRecentPackageSavedInOptions ()
{
CreateRecentPackages ();
var package = new FakePackage ("Test");
aggregateRepository.FakePackages.Add (package);
recentPackages.Add (new RecentPackageInfo (package));
CreateRepository (recentPackages);
return package;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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 ());
}
示例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;
}