예제 #1
0
        public void assert_redirect_to_a_target()
        {
            var input = new InputModel();
            FubuContinuation continuation = FubuContinuation.RedirectTo(input);

            continuation.AssertWasRedirectedTo(input);

            shouldFail(() => continuation.AssertWasRedirectedTo(new InputModel()));
            shouldFail(() => continuation.AssertWasContinuedToNextBehavior());

            shouldFail(() => continuation.AssertWasTransferedTo<ControllerTarget>(x => x.OneInOneOut(null)));
            shouldFail(() => continuation.AssertWasRedirectedTo<ControllerTarget>(x => x.OneInOneOut(null)));
        }
예제 #2
0
        public void assert_redirect_to_a_target_via_predicate()
        {
            var input = new InputModel { Name = "Luke", Age = 1 };
            FubuContinuation continuation = FubuContinuation.RedirectTo(input);

            continuation.AssertWasRedirectedTo<InputModel>(x => x.Name == input.Name);

            shouldFail(() => continuation.AssertWasRedirectedTo(new InputModelWithEquals()));
            shouldFail(() => continuation.AssertWasTransferedTo(input));
            shouldFail(() => continuation.AssertWasContinuedToNextBehavior());

            shouldFail(() => continuation.AssertWasTransferedTo<ControllerTarget>(x => x.OneInOneOut(null)));
            shouldFail(() => continuation.AssertWasRedirectedTo<ControllerTarget>(x => x.OneInOneOut(null)));
        }
예제 #3
0
        public void transfer_to_a_target()
        {
            var input = new InputModel();
            FubuContinuation continuation = FubuContinuation.TransferTo(input);

            continuation.Type.ShouldEqual(ContinuationType.Transfer);

            continuation.Process(director);

            director.AssertWasCalled(x => x.TransferTo(input));
        }
 public void Move(InputModel model)
 {
 }
 public void Go(InputModel model)
 {
 }
예제 #6
0
        public void redirect_to_a_target_with_category()
        {
            var input = new InputModel();
            FubuContinuation continuation = FubuContinuation.RedirectTo(input, "PUT");

            continuation.Type.ShouldEqual(ContinuationType.Redirect);

            continuation.Process(director);

            director.AssertWasCalled(x => x.RedirectTo(input, "PUT"));
        }
예제 #7
0
        public void assert_was_redirected_to_destination_respects_category()
        {
            var input = new InputModel { Name = "Luke", Age = 1 };
            var continuation = FubuContinuation.RedirectTo(input, "PUT");

            continuation.AssertWasRedirectedTo(input, "PUT");

            shouldFail(() => continuation.AssertWasRedirectedTo(input));
            shouldFail(() => continuation.AssertWasRedirectedTo(input, "GET"));
        }
예제 #8
0
        public void assert_transfer_by_destination_respects_category()
        {
            var input = new InputModel { Name = "Luke", Age = 1 };
            var continuation = FubuContinuation.TransferTo(input, "PUT");

            continuation.AssertWasTransferedTo(input, "PUT");

            shouldFail(() => continuation.AssertWasTransferedTo(input));
            shouldFail(() => continuation.AssertWasTransferedTo(input, "GET"));
        }
        public void transfer_to_a_target_with_a_method()
        {
            var input = new InputModel();
            FubuContinuation continuation = FubuContinuation.TransferTo(input, "PUT");

            continuation.Type.ShouldBe(ContinuationType.Transfer);

            continuation.Process(director);

            director.AssertWasCalled(x => x.TransferTo(input, "PUT"));
        }
예제 #10
0
        public void redirect_to_a_target()
        {
            var input = new InputModel();
            FubuContinuation continuation = FubuContinuation.RedirectTo(input);

            continuation.Type.ShouldBe(ContinuationType.Redirect);

            continuation.Process(director);

            director.AssertWasCalled(x => x.RedirectTo(input));
        }