コード例 #1
0
 /// <summary>
 /// Returns a <see cref="ICheck{T}" /> instance that will provide check methods to be executed on a given async function (returning Task{TResult}).
 /// </summary>
 /// <typeparam name="TResult">The type of the result for this asynchronous function.</typeparam>
 /// <param name="awaitableFunction">The asynchronous function to be tested.</param>
 /// <returns>
 /// A <see cref="ICheck{RunTrace}" /> instance to use in order to assert things on the given value.
 /// </returns>
 /// <remarks>
 /// Every method of the returned <see cref="ICheck{T}" /> instance will throw a <see cref="FluentCheckException" /> when failing.
 /// </remarks>
 public static ICheck <RunTraceResult <TResult> > ThatAsyncCode <TResult>(Func <Task <TResult> > awaitableFunction)
 {
     return(new FluentCheck <RunTraceResult <TResult> >(RunTrace.GetAsyncTrace(awaitableFunction), Reporter));
 }
コード例 #2
0
 /// <summary>
 /// Returns a <see cref="ICheck{T}" /> instance that will provide check methods to be executed on a given async code (returning Task).
 /// </summary>
 /// <param name="awaitableMethod">The async code to be tested.</param>
 /// <returns>
 /// A <see cref="ICheck{RunTrace}" /> instance to use in order to assert things on the given value.
 /// </returns>
 /// <remarks>
 /// Every method of the returned <see cref="ICheck{T}" /> instance will throw a <see cref="FluentCheckException" /> when failing.
 /// </remarks>
 public static ICheck <RunTrace> ThatAsyncCode(Func <Task> awaitableMethod)
 {
     return(new FluentCheck <RunTrace>(RunTrace.GetAsyncTrace(awaitableMethod), Reporter));
 }