Exemplo n.º 1
0
        protected override void InnerInvoke(Action <IActionBehavior> behaviorAction)
        {
            var task = FubuRequest.Get <Task <T> >();

            task.ContinueWith(x =>
            {
                FubuRequest.Set(task.Result);
                behaviorAction(InsideBehavior);
            }, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.AttachedToParent);
        }
Exemplo n.º 2
0
        protected override void invoke(Action action)
        {
            var task = FubuRequest.Get <Task <T> >();

            task.ContinueWith(x =>
            {
                FubuRequest.Set(task.Result);
                action();
            }, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.AttachedToParent);
        }
        public void SetsPropertyFromContextOnModel()
        {
            var binder = new FubuRequestPropertyBinder();
            var model = new FubuRequestModel();
            var context = new Mock<IBindingContext>();
            var fubuRequest = new FubuRequest(null, null);

            context.Setup(x => x.Service<IFubuRequest>()).Returns(fubuRequest);
            context.SetupGet(x => x.Object).Returns(model);

            binder.Bind(model.GetType().GetProperty("Request"), context.Object);

            model.Request.ShouldEqual(fubuRequest);
        }
Exemplo n.º 4
0
 public override void InvokePartial()
 {
     internalInvoke <Task <T> >(task => FubuRequest.Set(task.Result), x => x.InvokePartial());
 }