Ejemplo n.º 1
0
        public void SetResult_is_noop_when_not_implemented()
        {
            var handler        = new Mock <HandlerBase>();
            var wrappedHandler = new WrappedResultHandler(handler.Object);

            wrappedHandler.SetResult("Value1");
        }
Ejemplo n.º 2
0
        public void SetResult_invokes_when_implemented()
        {
            var handler        = new Mock <HandlerBase>().As <IResultHandler>();
            var wrappedHandler = new WrappedResultHandler(handler.Object);

            wrappedHandler.SetResult("Value1");

            handler.Verify(h => h.SetResult("Value1"));
        }
Ejemplo n.º 3
0
            /// <summary>
            /// Initializes a new instance of the <see cref="OperationBase" /> class.
            /// </summary>
            /// <param name="handler">An object to handle callbacks during the operation.</param>
            protected OperationBase(object handler)
            {
                Check.NotNull(handler, nameof(handler));

                _handler = new WrappedResultHandler(handler);
            }