本文整理匯總了C#中NuGet.PackageBuilder.IsReleaseVersion方法的典型用法代碼示例。如果您正苦於以下問題:C# PackageBuilder.IsReleaseVersion方法的具體用法?C# PackageBuilder.IsReleaseVersion怎麽用?C# PackageBuilder.IsReleaseVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NuGet.PackageBuilder
的用法示例。
在下文中一共展示了PackageBuilder.IsReleaseVersion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BuildPackageToStream
private Stream BuildPackageToStream(ManifestMetadata metadata, Stream outputStream)
{
string testDir = TestUtils.EnsureTestDirectoryExists(this.TestContext, "source");
string dummyTextFile = TestUtils.CreateTextFile(Guid.NewGuid().ToString(), testDir, "content");
PackageBuilder packageBuilder = new PackageBuilder();
PhysicalPackageFile file = new PhysicalPackageFile();
file.SourcePath = dummyTextFile;
file.TargetPath = "dummy.txt";
packageBuilder.Files.Add(file);
packageBuilder.Populate(metadata);
packageBuilder.Save(outputStream);
// Assert correct function of the above code when versions are specifically "Release" or "Prerelease"
if (String.Equals(metadata.Version, ReleaseVersion, StringComparison.CurrentCulture))
{
Assert.IsTrue(packageBuilder.IsReleaseVersion());
}
else if (String.Equals(metadata.Version, PreReleaseVersion, StringComparison.CurrentCulture))
{
Assert.IsFalse(packageBuilder.IsReleaseVersion());
}
return outputStream;
}