new mailling for not confirmed emails
This commit is contained in:
parent
14bb4addbd
commit
45d76a2917
25 changed files with 46 additions and 31 deletions
33
test/yavscTests/TestHelpers.cs
Normal file
33
test/yavscTests/TestHelpers.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace test {
|
||||
|
||||
public static class AssertAsync {
|
||||
|
||||
public static void CompletesIn(int timeout, Action action)
|
||||
{
|
||||
var task = Task.Run(action);
|
||||
var completedInTime = Task.WaitAll(new[] { task }, TimeSpan.FromSeconds(timeout));
|
||||
|
||||
if (task.Exception != null)
|
||||
{
|
||||
if (task.Exception.InnerExceptions.Count == 1)
|
||||
{
|
||||
throw task.Exception.InnerExceptions[0];
|
||||
}
|
||||
|
||||
throw task.Exception;
|
||||
}
|
||||
|
||||
if (!completedInTime)
|
||||
{
|
||||
throw new TimeoutException($"Task did not complete in {timeout} seconds.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue