Ejemplo n.º 1
0
        /// <summary>
        /// Returns a <see cref="ICheck{T}" /> instance that will provide check methods to be executed on a lambda.
        /// </summary>
        /// <typeparam name="TU">Result type of the function.</typeparam>
        /// <param name="value">The code to be tested.</param>
        /// <returns>
        /// A <see cref="ICheck{RunTrace}" /> instance to use in order to assert things on the lambda.
        /// </returns>
        /// <remarks>
        /// Every method of the returned <see cref="ICheck{T}" /> instance will throw a <see cref="FluentCheckException" /> when failing.
        /// </remarks>
        public ICodeCheck <RunTraceResult <TU> > ThatCode <TU>(Func <TU> value)
        {
            var result = new FluentCodeCheck <RunTraceResult <TU> >(FluentCodeCheck <RunTraceResult <TU> > .GetTrace(value));

            result.CustomMessage = this.message;
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a <see cref="ICheck{T}" /> instance that will provide check methods to be executed on a given value.
        /// </summary>
        /// <param name="value">The 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 ICodeCheck <RunTrace> ThatCode(Action value)
        {
            var result = new FluentCodeCheck <RunTrace>(FluentCodeCheck <RunTraceResult <Action> > .GetTrace(value));

            result.CustomMessage = this.message;
            return(result);
        }