naps2/NAPS2.App.Tests/WorkerAppTests.cs

26 lines
722 B
C#
Raw Normal View History

2022-06-20 04:40:16 +03:00
using GrpcDotNetNamedPipes;
using NAPS2.Remoting.Worker;
using NAPS2.Sdk.Tests;
using Xunit;
namespace NAPS2.App.Tests;
2022-06-20 04:40:16 +03:00
public class WorkerAppTests : ContextualTexts
{
[Fact]
2022-06-20 04:40:16 +03:00
public void CreatesPipeServer()
{
var process = AppTestHelper.StartProcess("NAPS2.Worker.exe", FolderPath, Process.GetCurrentProcess().Id.ToString());
try
{
Assert.Equal("ready", process.StandardOutput.ReadLine());
2022-06-20 04:40:16 +03:00
string pipeName = $"NAPS2.Worker/{process.Id}";
var client = new WorkerServiceAdapter(new NamedPipeChannel(".", pipeName));
client.Init(FolderPath);
}
finally
{
AppTestHelper.Cleanup(process);
}
}
}