mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add failing test
This commit is contained in:
39
test/Velopack.Packaging.Tests/OsxPackTests.cs
Normal file
39
test/Velopack.Packaging.Tests/OsxPackTests.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Runtime.Versioning;
|
||||
using Velopack.Compression;
|
||||
|
||||
namespace Velopack.Packaging.Tests;
|
||||
|
||||
[SupportedOSPlatform("osx")]
|
||||
public class OsxPackTests
|
||||
{
|
||||
private readonly ITestOutputHelper _output;
|
||||
|
||||
public OsxPackTests(ITestOutputHelper output)
|
||||
{
|
||||
_output = output;
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
public void PackBuildUsesAppTitleAsBundleName()
|
||||
{
|
||||
Skip.IfNot(VelopackRuntimeInfo.IsOSX);
|
||||
|
||||
using var logger = _output.BuildLoggerFor<OsxPackTests>();
|
||||
|
||||
using var _1 = Utility.GetTempDirectory(out var tmpOutput);
|
||||
using var _2 = Utility.GetTempDirectory(out var tmpReleaseDir);
|
||||
using var _3 = Utility.GetTempDirectory(out var unzipDir);
|
||||
|
||||
const string id = "MyAppId";
|
||||
const string title = "MyAppTitle";
|
||||
const string channel = "asd123";
|
||||
|
||||
TestApp.PackTestApp(id, "0.0.1", string.Empty, tmpReleaseDir, logger, channel: channel, packTitle: title);
|
||||
|
||||
var portablePath = Path.Combine(tmpReleaseDir, $"{id}-{channel}-Portable.zip");
|
||||
EasyZip.ExtractZipToDirectory(logger, portablePath, unzipDir);
|
||||
|
||||
var bundlePath = Path.Combine(unzipDir, $"{title}.app");
|
||||
Assert.True(Directory.Exists(bundlePath));
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace Velopack.Packaging.Tests;
|
||||
public static class TestApp
|
||||
{
|
||||
public static void PackTestApp(string id, string version, string testString, string releaseDir, ILogger logger,
|
||||
string releaseNotes = null, string channel = null, RID targetRid = null)
|
||||
string releaseNotes = null, string channel = null, RID targetRid = null, string packTitle = null)
|
||||
{
|
||||
targetRid ??= RID.Parse(VelopackRuntimeInfo.SystemRid);
|
||||
|
||||
@@ -40,6 +40,7 @@ public static class TestApp
|
||||
var options = new WindowsPackOptions {
|
||||
EntryExecutableName = "TestApp.exe",
|
||||
ReleaseDir = new DirectoryInfo(releaseDir),
|
||||
PackTitle = packTitle,
|
||||
PackId = id,
|
||||
TargetRuntime = targetRid,
|
||||
PackVersion = version,
|
||||
@@ -53,6 +54,7 @@ public static class TestApp
|
||||
var options = new OsxPackOptions {
|
||||
EntryExecutableName = "TestApp",
|
||||
ReleaseDir = new DirectoryInfo(releaseDir),
|
||||
PackTitle = packTitle,
|
||||
PackId = id,
|
||||
TargetRuntime = targetRid,
|
||||
PackVersion = version,
|
||||
@@ -70,6 +72,7 @@ public static class TestApp
|
||||
var options = new LinuxPackOptions {
|
||||
EntryExecutableName = "TestApp",
|
||||
ReleaseDir = new DirectoryInfo(releaseDir),
|
||||
PackTitle = packTitle,
|
||||
PackId = id,
|
||||
TargetRuntime = targetRid,
|
||||
PackVersion = version,
|
||||
|
||||
Reference in New Issue
Block a user