本文整理汇总了C#中ICSharpCode.PackageManagement.Design.FakePackageRepository.AddFakePackageWithVersion方法的典型用法代码示例。如果您正苦于以下问题:C# FakePackageRepository.AddFakePackageWithVersion方法的具体用法?C# FakePackageRepository.AddFakePackageWithVersion怎么用?C# FakePackageRepository.AddFakePackageWithVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.PackageManagement.Design.FakePackageRepository
的用法示例。
在下文中一共展示了FakePackageRepository.AddFakePackageWithVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateProject
public void GetUpdatedPackages_OnePackageReferencedWithConstraintAndUpdatesAvailable_LatestVersionReturnedBasedOnConstraint()
{
CreateProject();
project.FakePackages.Add(new FakePackage("Test", "1.0"));
var sourceRepository = new FakePackageRepository();
FakePackage packageVersion2 = sourceRepository.AddFakePackageWithVersion("Test", "2.0");
FakePackage [] expectedPackages = new [] {
packageVersion2
};
sourceRepository.AddFakePackageWithVersion("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;
CreateUpdatedPackages(sourceRepository);
IEnumerable<IPackage> packages = updatedPackages.GetUpdatedPackages();
PackageCollectionAssert.AreEqual(expectedPackages, packages);
}