mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Decouple Spectre from Packaging, refactor command/compat
This commit is contained in:
18
test/Velopack.CommandLine.Tests/AutoMapperTests.cs
Normal file
18
test/Velopack.CommandLine.Tests/AutoMapperTests.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Velopack.Vpk;
|
||||
|
||||
namespace Velopack.CommandLine.Tests
|
||||
{
|
||||
public class AutoMapperTests
|
||||
{
|
||||
[Fact]
|
||||
public void AutoMapperConfigIsValid()
|
||||
{
|
||||
CommandMapper.Validate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class GitHubDownloadCommandTests : GitHubCommandTests<GitHubDownloadComma
|
||||
string cli = GetRequiredDefaultOptions() + "--pre";
|
||||
ParseResult parseResult = command.ParseAndApply(cli);
|
||||
|
||||
Assert.True(command.Pre);
|
||||
Assert.True(command.Prerelease);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public abstract class ReleaseCommandTests<T> : BaseCommandTests<T>
|
||||
string cli = GetRequiredDefaultOptions() + "--delta none";
|
||||
ParseResult parseResult = command.ParseAndApply(cli);
|
||||
|
||||
Assert.True(command.Delta == Packaging.DeltaMode.None);
|
||||
Assert.True(command.DeltaMode == Packaging.DeltaMode.None);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Velopack.Packaging.Unix.Commands;
|
||||
using Velopack.Packaging.Windows.Commands;
|
||||
using Velopack.Vpk.Logging;
|
||||
|
||||
namespace Velopack.Packaging.Tests
|
||||
{
|
||||
@@ -46,7 +47,7 @@ namespace Velopack.Packaging.Tests
|
||||
ReleaseNotes = releaseNotes,
|
||||
Channel = channel,
|
||||
};
|
||||
var runner = new WindowsPackCommandRunner(logger);
|
||||
var runner = new WindowsPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
} else if (VelopackRuntimeInfo.IsOSX) {
|
||||
var options = new OsxPackOptions {
|
||||
@@ -60,7 +61,7 @@ namespace Velopack.Packaging.Tests
|
||||
ReleaseNotes = releaseNotes,
|
||||
Channel = channel,
|
||||
};
|
||||
var runner = new OsxPackCommandRunner(logger);
|
||||
var runner = new OsxPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
} else if (VelopackRuntimeInfo.IsLinux) {
|
||||
var options = new LinuxPackOptions {
|
||||
@@ -74,7 +75,7 @@ namespace Velopack.Packaging.Tests
|
||||
ReleaseNotes = releaseNotes,
|
||||
Channel = channel,
|
||||
};
|
||||
var runner = new LinuxPackCommandRunner(logger);
|
||||
var runner = new LinuxPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
} else {
|
||||
throw new PlatformNotSupportedException();
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Velopack.Deployment\Velopack.Deployment.csproj" />
|
||||
<ProjectReference Include="..\..\src\Velopack.Packaging.Unix\Velopack.Packaging.Unix.csproj" />
|
||||
<ProjectReference Include="..\..\src\Velopack.Packaging.Windows\Velopack.Packaging.Windows.csproj" />
|
||||
<ProjectReference Include="..\..\src\Velopack.Vpk\Velopack.Vpk.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -9,6 +9,7 @@ using Velopack.Compression;
|
||||
using Velopack.Packaging.Commands;
|
||||
using Velopack.Packaging.Exceptions;
|
||||
using Velopack.Packaging.Windows.Commands;
|
||||
using Velopack.Vpk.Logging;
|
||||
using Velopack.Windows;
|
||||
|
||||
namespace Velopack.Packaging.Tests;
|
||||
@@ -55,7 +56,7 @@ public class WindowsPackTests
|
||||
Channel = "asd123"
|
||||
};
|
||||
|
||||
var runner = new WindowsPackCommandRunner(logger);
|
||||
var runner = new WindowsPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
|
||||
var nupkgPath = Path.Combine(tmpReleaseDir, $"{id}-{version}-asd123-full.nupkg");
|
||||
@@ -118,7 +119,7 @@ public class WindowsPackTests
|
||||
TargetRuntime = RID.Parse("win"),
|
||||
};
|
||||
|
||||
var runner = new WindowsPackCommandRunner(logger);
|
||||
var runner = new WindowsPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
|
||||
Assert.Throws<UserInfoException>(() => runner.Run(options).GetAwaiterResult());
|
||||
@@ -155,7 +156,7 @@ public class WindowsPackTests
|
||||
Channel = "hello",
|
||||
};
|
||||
|
||||
var runner = new WindowsPackCommandRunner(logger);
|
||||
var runner = new WindowsPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
|
||||
options.TargetRuntime = RID.Parse("win10.0.19043-x86");
|
||||
@@ -190,7 +191,7 @@ public class WindowsPackTests
|
||||
PackDirectory = tmpOutput,
|
||||
};
|
||||
|
||||
var runner = new WindowsPackCommandRunner(logger);
|
||||
var runner = new WindowsPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
|
||||
var setupPath1 = Path.Combine(tmpReleaseDir, $"{id}-win-Setup.exe");
|
||||
@@ -305,7 +306,7 @@ public class WindowsPackTests
|
||||
|
||||
// apply delta and check package
|
||||
var output = Path.Combine(releaseDir, "delta.patched");
|
||||
new DeltaPatchCommandRunner(logger).Run(new DeltaPatchOptions {
|
||||
new DeltaPatchCommandRunner(logger, new BasicConsole(logger)).Run(new DeltaPatchOptions {
|
||||
BasePackage = Path.Combine(releaseDir, $"{id}-1.0.0-full.nupkg"),
|
||||
OutputFile = output,
|
||||
PatchFiles = new[] { new FileInfo(deltaPath) },
|
||||
@@ -679,7 +680,7 @@ public class WindowsPackTests
|
||||
PackDirectory = Path.Combine(projDir, "publish"),
|
||||
};
|
||||
|
||||
var runner = new WindowsPackCommandRunner(logger);
|
||||
var runner = new WindowsPackCommandRunner(logger, new BasicConsole(logger));
|
||||
runner.Run(options).GetAwaiterResult();
|
||||
} finally {
|
||||
File.WriteAllText(testStringFile, oldText);
|
||||
|
||||
Reference in New Issue
Block a user