예제 #1
0
파일: Check.cs 프로젝트: Ouarzy/NFluent
 /// <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> >(CodeCheckExtensions.GetAsyncTrace(awaitableFunction)));
 }
예제 #2
0
파일: Check.cs 프로젝트: Ouarzy/NFluent
 /// <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>(CodeCheckExtensions.GetAsyncTrace(awaitableMethod)));
 }