示例#1
0
        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);
        }
示例#2
0
 private void ConfigureJsonFactory <TJson>()
     where TJson : class
 {
     JsonFactory.Setup(f => f.Create <TJson>())
     .Returns(JsonObjectFactory.Get <TJson>().Object);
 }