Exemple #1
0
 public PokeAPIClient(string baseURL, IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     BaseURL            = baseURL;
     RestClientFactory  = restClientFactory;
     RestRequestFactory = restRequestFactory;
     Limiter            = InitializeLimiter();
 }
 public LaunchpadRepository(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory, IJsonResponseDeserializer deserializer, ILogger <BaseRepository> logger) : base(logger)
 {
     _restClientFactory  = restClientFactory;
     _restRequestFactory = restRequestFactory;
     _deserializer       = deserializer;
     _baseUrl            = Environment.GetEnvironmentVariable("SPACEX_API_BASE_URL");
 }
Exemple #3
0
 public JobProfileApi(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory, AppSettings appSettings, APISettings apiSettings)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
     this.appSettings        = appSettings;
     this.apiSettings        = apiSettings;
 }
 public WeatherAPI(IErrorLogger errorLogger,
                   IRestClientFactory restClientFactory,
                   IRestRequestFactory restRequestFactory)
 {
     _errorLogger        = errorLogger;
     _restRequestFactory = restRequestFactory;
     _restClientFactory  = restClientFactory;
 }
Exemple #5
0
 /// <summary>Start a new RestSession</summary>
 /// <param name="endPoint">the URL of the end point, i.e. base URL. Can be null if set separately</param>
 /// <param name="context">the session context</param>
 /// <param name="requestFactory">the factory creating RestRequest objects</param>
 public RestSession(string endPoint, SessionContext context, IRestRequestFactory requestFactory)
 {
     EndPoint            = endPoint != null ? new Uri(endPoint) : null;
     Context             = context;
     Request             = null;
     Response            = null;
     RequestHeadersToAdd = new NameValueCollection();
     _requestFactory     = requestFactory;
 }
        public JsonEndpointTests()
        {
            this._restClientFactory  = new RestClientFactory();
            this._restRequestFactory = new RestRequestFactory();

            _id = 1;

            _baseEndpoint = "https://jsonplaceholder.typicode.com/";
        }
Exemple #7
0
 public RestClientProxy(
     IRestRequestFactory restRequestFactory,
     IRestClient restClient,
     ILogger <RestClientProxy> logger)
 {
     _restRequestFactory = restRequestFactory;
     _restClient         = restClient;
     _logger             = logger;
 }
 public GooglePlacesAPI(
     IErrorLogger errorLogger,
     IRestClientFactory restClientFactory,
     IRestRequestFactory restRequestFactory)
 {
     _errorLogger        = errorLogger;
     _restRequestFactory = restRequestFactory;
     _restClientFactory  = restClientFactory;
 }
 public TwitterApiService(
     IRestClientFactory restClientFactory,
     IRestRequestFactory restRequestFactory,
     TwitterAccessTokenProvider accessTokenProvider)
 {
     this.restClientFactory   = restClientFactory;
     this.restRequestFactory  = restRequestFactory;
     this.accessTokenProvider = accessTokenProvider;
 }
 public void Setup()
 {
     this.appSettings        = new AppSettings();
     this.restClientFactory  = A.Fake <IRestClientFactory>();
     this.restRequestFactory = A.Fake <IRestRequestFactory>();
     this.restClient         = A.Fake <IRestClient>();
     this.restRequest        = A.Fake <IRestRequest>();
     A.CallTo(() => this.restClientFactory.Create(A <Uri> .Ignored)).Returns(this.restClient);
     A.CallTo(() => this.restRequestFactory.Create(A <string> .Ignored)).Returns(this.restRequest);
     this.jobProfileOverviewAPI = new JobProfileOverviewAPI(this.restClientFactory, this.restRequestFactory, this.appSettings);
 }
        public MeetupProvider(
            IRestClientFactory restClientFactory,
            IRestRequestFactory restRequestFactory,
            ISecureCredentialsProvider apiKeyProvider)
        {
            this.restClientFactory = restClientFactory;

            this.restRequestFactory = restRequestFactory;

            this.apiKeyProvider = apiKeyProvider;
        }
Exemple #12
0
 public RestService(IRestClient restClient,
                    IRestRequestFactory requestFactory)
 {
     this.restClient     = restClient;
     this.requestFactory = requestFactory;
 }
 public RestaurantService(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
 }
Exemple #14
0
 public JiraApiRequestFactory(IRestRequestFactory restRequestFactory)
 {
     this.restRequestFactory = restRequestFactory;
     this.username           = "";
     this.password           = "";
 }
Exemple #15
0
 public RestClientService(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     _restClientFactory  = restClientFactory;
     _restRequestFactory = restRequestFactory;
 }
Exemple #16
0
 public AdRequestor(IRestClient restClient,
                    IRestRequestFactory requestFactory)
     : base(restClient, requestFactory)
 {
 }
Exemple #17
0
 public CareerPathAPI(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory, AppSettings appSettings)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
     this.appSettings        = appSettings;
 }
 public RestApiHelper(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     this.RestClientFactory  = restClientFactory;
     this.RestRequestFactory = restRequestFactory;
 }
Exemple #19
0
   public AdRequestor(IRestClient restClient,
 IRestRequestFactory requestFactory)
       : base(restClient, requestFactory)
   {
   }
        public PostcodeService(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
        {
            this.restClientFactory = restClientFactory;

            this.restRequestFactory = restRequestFactory;
        }
 public JiraApiRequestFactory(IRestRequestFactory restRequestFactory)
 {
     this.restRequestFactory = restRequestFactory;
     this.username = "";
     this.password = "";
 }
 public RestaurantService(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     this.restClientFactory = restClientFactory;
     this.restRequestFactory = restRequestFactory;
 }
 public RelatedCareersAPI(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory, AppSettings appSettings)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
     this.appSettings        = appSettings;
 }
 //Since https://github.com/restsharp/RestSharp/commit/2781d7e11544a67c9bfb300edc43a0947ab7986f, RestSharp.RestRequest.AddFile()
 //has started reading the given file using IO. Therefore creating the RestRequest and calling AddFile in the same factory prevents
 //unit testing without having the actual files in the IO.
 internal RestFileRequestFactory(IRestRequestFactory restRequestFactory)
 {
     this.restRequestFactory = restRequestFactory;
 }
 public JiraApiRequestFactory(IRestRequestFactory restRequestFactory)
 {
     this.restRequestFactory = restRequestFactory;
 }
 public RegisterAPITest()
 {
     clientFactory  = new RestClientFactory();
     requestFactory = new RestRequestFactory();
     createRestCall = new CreateRestCall(clientFactory, requestFactory);
 }
 //Since https://github.com/restsharp/RestSharp/commit/2781d7e11544a67c9bfb300edc43a0947ab7986f, RestSharp.RestRequest.AddFile()
 //has started reading the given file using IO. Therefore creating the RestRequest and calling AddFile in the same factory prevents
 //unit testing without having the actual files in the IO.
 internal RestFileRequestFactory(IRestRequestFactory restRequestFactory)
 {
     this.restRequestFactory = restRequestFactory;
 }
        protected override RestFileRequestFactory CreateSut()
        {
            restRequestFactory = Mock <IRestRequestFactory>();

            return(new RestFileRequestFactory(restRequestFactory));
        }
Exemple #29
0
 public JobProfileOverviewAPI(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory, AppSettings appSettings)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
     this.appSettings        = appSettings;
 }
 public CreateRestCall(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
 }
Exemple #31
0
 public MathWebClient(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     _baseUrl            = "http://localhost:55417/";
     _restClientFactory  = restClientFactory;
     _restRequestFactory = restRequestFactory;
 }
 //Dependency Injection - Type is - Constructor Injection
 #region Constructor Injection
 public ConsumeService(IRestClientFactory restClientFactory, IRestRequestFactory restRequestFactory)
 {
     this.restClientFactory  = restClientFactory;
     this.restRequestFactory = restRequestFactory;
 }