예제 #1
0
        public void ShouldGetCruiseRequestForRequestAndProxyAction()
        {
            IResponse response = new HtmlFragmentResponse("foo");

            // Setup
            cruiseRequestFactoryMock.Setup(factory => factory.CreateCruiseRequest(request,
                                                                                  (ICruiseUrlBuilder)urlBuilderMock.Object, null)).Returns(cruiseRequest).Verifiable();
            proxiedActionMock.Setup(_action => _action.Execute(cruiseRequest)).Returns(response).Verifiable();

            // Execute
            IResponse returnedResponse = proxy.Execute(request);

            // Verify
            Assert.AreEqual(response, returnedResponse);
            VerifyAll();
        }
        public void ShouldGetCruiseRequestForRequestAndProxyAction()
        {
            IResponse response = new HtmlFragmentResponse("foo");

            // Setup
            cruiseRequestFactoryMock.ExpectAndReturn("CreateCruiseRequest", cruiseRequest, request,
                                                     (ICruiseUrlBuilder)urlBuilderMock.MockInstance, null);
            proxiedActionMock.ExpectAndReturn("Execute", response, cruiseRequest);

            // Execute
            IResponse returnedResponse = proxy.Execute(request);

            // Verify
            Assert.AreEqual(response, returnedResponse);
            VerifyAll();
        }