public void SetUp() { _jsonSerializer = MockRepository.GenerateStub<IJsonSerializer>(); _responseUpdater = MockRepository.GenerateStub<IResponseUpdater>(); _serializationDataProvider = MockRepository.GenerateStub<ISerializationDataProvider>(); _serializationDataProviderFactory = MockRepository.GenerateStub<ISerializationDataProviderFactory>(); _serializationDataProviderFactory.Stub(f => f.Build(Arg<object>.Is.Anything)).Return(_serializationDataProvider); _responseWriter = new JsonPResponseWriter(_jsonSerializer, _responseUpdater,_serializationDataProviderFactory); _controllerContext = MockRepository.GenerateStrictMock<ControllerContext>(); _routeData = new RouteData(); _controllerContext.Stub(c => c.RouteData).Return(_routeData); _routeData.Values.Add("callback", CALLBACK); _jsonSerializer.Stub(s => s.Serialize(Arg<object>.Is.Anything)).Return(JSON_OUTPUT); }