build cli

This commit is contained in:
Paul Schneider 2025-07-16 00:47:50 +01:00
commit 5c046dfa88
34 changed files with 7153 additions and 1231 deletions

View file

@ -4,11 +4,15 @@ using System.Threading.Tasks;
namespace yavscTests {
public static class AssertAsync {
public static void CompletesIn(int timeout, Action action)
/// <summary>
/// Completes In
/// </summary>
/// <param name="timeoutFromSecond"></param>
/// <param name="action"></param>
public static void CompletesIn(int timeoutFromSecond, Action action)
{
var task = Task.Run(action);
var completedInTime = Task.WaitAll(new[] { task }, TimeSpan.FromSeconds(timeout));
var completedInTime = Task.WaitAll(new[] { task }, TimeSpan.FromSeconds(timeoutFromSecond));
if (task.Exception != null)
{
@ -22,7 +26,7 @@ namespace yavscTests {
if (!completedInTime)
{
throw new TimeoutException($"Task did not complete in {timeout} seconds.");
throw new TimeoutException($"Task did not complete in {timeoutFromSecond} seconds.");
}
}
}