Example #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 ICodeCheck <RunTraceResult <TResult> > ThatAsyncCode <TResult>(Func <Task <TResult> > awaitableFunction)
 {
     return(new FluentCodeCheck <RunTraceResult <TResult> >(FluentCodeCheck <RunTraceResult <Task <TResult> > > .GetAsyncTrace(awaitableFunction)));
 }
Example #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 ICodeCheck <RunTrace> ThatAsyncCode(Func <Task> awaitableMethod)
 {
     return(new FluentCodeCheck <RunTrace>(FluentCodeCheck <RunTraceResult <Func <Task> > > .GetAsyncTrace(awaitableMethod)));
 }