Run test dummy through the app host

This commit is contained in:
Tyrrrz
2023-08-07 21:55:37 +03:00
parent d2e390c691
commit c95b6c32d5
5 changed files with 19 additions and 27 deletions

View File

@@ -1,19 +1,20 @@
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
namespace CliFx.Tests.Dummy;
// This dummy application is used in tests for scenarios that require an external process to properly verify
public static partial class Program
public static class Program
{
public static Assembly Assembly { get; } = Assembly.GetExecutingAssembly();
// Path to the apphost
public static string FilePath { get; } = Path.ChangeExtension(
Assembly.GetExecutingAssembly().Location,
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "exe" : null
);
public static string Location { get; } = Assembly.Location;
}
public static partial class Program
{
public static async Task Main()
{
// Make sure color codes are not produced because we rely on the output in tests