Ejemplo n.º 1
0
 private IConfigure MeasureExecutionTime(Optional <IStopwatch> options)
 {
     _buildInvokeChain.Add(
         new StopWatchDecorator(
             options.ValueOr(new StopwatchTimer()
                             )
             )
         );
     return(this);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds an action to perform on the fixture.<br />
        /// This uses the result of the previous invocation.
        /// </summary>
        /// <param name="action">The action.</param>
        public ITestDefinition <TFixture> InvokeWithResult(TestActionWithResult <TFixture> action)
        {
            void Newaction(TFixture x)
            {
                action(x, GetLastResult());
                InvokeResults.Add(new InvokeResult());
            }

            InvokeList.Add(Newaction);
            return(this);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds a function to perform on the fixture.<br />
        /// </summary>
        /// <typeparam name="TResult">The type of the result.</typeparam>
        /// <param name="func">The function.</param>
        public ITestDefinition <TFixture> Invoke <TResult>(TestFunction <TFixture, TResult> func)
        {
            void Newaction(TFixture x)
            {
                var result = func(x);

                InvokeResults.Add(new InvokeResultObject(result));
            }

            InvokeList.Add(Newaction);
            return(this);
        }