public async Task Move() { MovePayload received = null !; var source = new CancellationTokenSource(); var task = PiperServer.Start(s => received = s, s => { }, source.Token); await PiperClient.SendMoveAsync("Foo", "Bar", "theExe", "TheArguments \"s\"", true, 10, source.Token); await Task.Delay(1000); source.Cancel(); await task; await Verifier.Verify(received); }
public static Task AddMoveAsync( string tempFile, string targetFile, string?exe, string?arguments, bool canKill, int?processId, CancellationToken cancellation = default) { if (!IsRunning) { return(Task.CompletedTask); } return(PiperClient.SendMoveAsync(tempFile, targetFile, exe, arguments, canKill, processId, cancellation)); }
public async Task SendOnly() { var file = Path.GetFullPath("temp.txt"); File.Delete(file); await File.WriteAllTextAsync(file, "a"); try { await PiperClient.SendMoveAsync(file, file, "theExe", "TheArguments \"s\"", true, 10); await PiperClient.SendDeleteAsync(file); } catch (InvalidOperationException) { } var settings = new VerifySettings(); settings.ScrubLinesContaining("temp.txt"); //TODO: add "scrub source dir" to verify and remove the below settings.ScrubLinesContaining("PiperClient"); await Verifier.Verify(Logs, settings); }