2022-06-20 04:40:16 +03:00
|
|
|
using GrpcDotNetNamedPipes;
|
2022-12-19 00:52:33 +03:00
|
|
|
using NAPS2.App.Tests.Targets;
|
2022-06-20 04:40:16 +03:00
|
|
|
using NAPS2.Remoting.Worker;
|
|
|
|
using NAPS2.Sdk.Tests;
|
2022-06-20 00:38:52 +03:00
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace NAPS2.App.Tests;
|
|
|
|
|
2022-07-17 05:05:51 +03:00
|
|
|
public class WorkerAppTests : ContextualTests
|
2022-06-20 00:38:52 +03:00
|
|
|
{
|
2022-12-19 00:52:33 +03:00
|
|
|
[Theory]
|
|
|
|
[ClassData(typeof(AppTestData))]
|
|
|
|
public void CreatesPipeServer(IAppTestTarget target)
|
2022-06-20 00:38:52 +03:00
|
|
|
{
|
2022-12-19 00:52:33 +03:00
|
|
|
var process = AppTestHelper.StartProcess(target.Worker, FolderPath, Process.GetCurrentProcess().Id.ToString());
|
2022-06-20 00:38:52 +03:00
|
|
|
try
|
|
|
|
{
|
|
|
|
Assert.Equal("ready", process.StandardOutput.ReadLine());
|
2022-11-13 22:09:22 +03:00
|
|
|
string pipeName = $"NAPS2.Worker.{process.Id}";
|
2022-06-20 04:40:16 +03:00
|
|
|
var client = new WorkerServiceAdapter(new NamedPipeChannel(".", pipeName));
|
|
|
|
client.Init(FolderPath);
|
2022-06-28 07:12:22 +03:00
|
|
|
AppTestHelper.AssertNoErrorLog(FolderPath);
|
2022-06-20 00:38:52 +03:00
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
AppTestHelper.Cleanup(process);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|