public IRestResponse <TRequest> Execute <TRequest>(IRestRequest request) where TRequest : class { var mockResponse = new Mock <IRestResponse <TRequest> >(); var mockData = JsonObjectFactory.Get <TRequest>(); mockResponse.SetupGet(r => r.Data) .Returns(mockData.Object); _calls.Add(typeof(TRequest)); return(mockResponse.Object); }
private void ConfigureJsonFactory <TJson>() where TJson : class { JsonFactory.Setup(f => f.Create <TJson>()) .Returns(JsonObjectFactory.Get <TJson>().Object); }