Пример #1
0
        public void should_build_partial_and_set_model()
        {
            var model = new InputModel();

            _page.Partial(model);

            _request.AssertWasCalled(r => r.Set(model));
            _partialFactory.AssertWasCalled(f => f.BuildPartial(typeof(InputModel)));
            _page.AssertWasCalled(p => p.Get <IPartialFactory>());
            _behavior.AssertWasCalled(b => b.InvokePartial());
        }
        public void should_set_authentication_token_on_fubu_request_when_validated()
        {
            IAuthenticationToken authToken = new AuthenticationToken {
                Token = _token
            };

            MockFor <IAuthenticationTokenRepository>().Stub(a => a.RetrieveByToken(_token)).Return(authToken);

            _cut.RightsFor(_context);

            _request.AssertWasCalled(a => a.Set(authToken));
        }