Esempio n. 1
0
        protected override void beforeEach()
        {
            theRequest = new TwitterLoginRequest {
                Url = "hello/there"
            };

            MockFor <IFubuRequest>().Stub(x => x.Get <TwitterLoginRequest>()).Return(theRequest);

            theLoginBehavior = MockFor <IActionBehavior>();

            var chain = new BehaviorChain();

            chain.AddToEnd(ActionCall.For <LoginController>(x => x.get_login(null)));

            var graph = new BehaviorGraph();

            graph.AddChain(chain);

            Services.Inject(graph);

            MockFor <IPartialFactory>().Stub(x => x.BuildPartial(chain)).Return(theLoginBehavior);

            ClassUnderTest.Failure();

            theLoginRequest = (LoginRequest)MockFor <IFubuRequest>().GetArgumentsForCallsMadeOn(x => x.Set(Arg <LoginRequest> .Is.NotNull))[0][0];
        }
Esempio n. 2
0
        protected override void beforeEach()
        {
            theRequest = new TwitterLoginRequest {
                Url = "hello/there"
            };

            MockFor <IFubuRequest>().Stub(x => x.Get <TwitterLoginRequest>()).Return(theRequest);

            ClassUnderTest.Success();
        }
        protected override void beforeEach()
        {
            theUrl     = "login/test";
            theRequest = new TwitterLoginRequest();
            theSignIn  = new TwitterSignIn();

            MockFor <IFubuRequest>().Stub(x => x.Get <TwitterSignIn>()).Return(theSignIn);

            MockFor <IUrlRegistry>().Stub(x => x.UrlFor(theSignIn)).Return(theUrl);

            ClassUnderTest.Write(MimeType.Html.Value, theRequest);

            var html = MimeType.Html.ToString();

            theTag = MockFor <IOutputWriter>()
                     .GetArgumentsForCallsMadeOn(x => x.Write(Arg <string> .Is.Same(html), Arg <string> .Is.NotNull))
                     [0][1].As <string>();
        }