public ScmBackup(IApiCaller apiCaller, IScmValidator validator, IBackupMaker backupMaker, IConfigBackupMaker configBackupMaker) { this.apiCaller = apiCaller; this.validator = validator; this.backupMaker = backupMaker; this.configBackupMaker = configBackupMaker; }
public void ExecuteAsync_Should_Return_Null_For_Null_ApiRequest() { IApiCaller apiCaller = GetApiCaller(); var response = AsyncHelper.RunSync(() => apiCaller.ExecuteAsync(null)); Assert.Null(response); }
public void Execute_Should_Return_Null_For_Null_ApiRequest() { IApiCaller apiCaller = GetApiCaller(); var response = apiCaller.Execute <ReqResApiResponse>(null); Assert.Null(response); }
public Scraper(IApiCaller apiCaller, IOptions <ApiSettings> apiSettings) { _apiSettings = apiSettings; _apiCaller = apiCaller; makelaarsWithPropertiesAmount = new Dictionary <string, int>(); makelaarsWithPropertiesWithGardenAmount = new Dictionary <string, int>(); }
internal Nets(string merchantId, string token, IApiCaller caller, IEndpoints endpoints) { this._merchantId = merchantId; this._token = token; this._caller = caller; this._endpoints = endpoints; }
public PrivatePageController( IApiCaller apiCaller, IHostingEnvironment environment ) { _apiCaller = apiCaller; _environment = environment; }
public MovieController( HttpClient httpClient, AbstractResponseFactory <Response> responseFactory, IApiCaller apiCaller) { _httpClient = httpClient; _responseFactory = responseFactory; _apiCaller = apiCaller; }
internal static Mock <IApiCaller> Get <T>(IApiCaller innerApiCaller = null) { innerApiCaller = innerApiCaller ?? new FileReaderApiCaller(); var mockApiCaller = new Mock <IApiCaller>(); SetupExecute <T>(mockApiCaller, innerApiCaller); SetupExecuteAsync(mockApiCaller, innerApiCaller); return(mockApiCaller); }
private void Refresh() { var url = ConfigurationManager.AppSettings.Get("ServiceUrl"); _apiCaller = new FrontEnd.ApiCaller.ApiCaller(url); var data = _apiCaller.GetServiceResponse <List <RegionViewModel> >("Region"); dgRegion.ItemsSource = data.Result; }
/// <summary> /// Initializes a new instance of the <see cref="CheckTypeApi"/> class. /// </summary> /// <returns></returns> public CheckTypeApi(String basePath, IApiCaller refitWrapper) { this.Configuration = new SegApiClient.Client.Configuration { BasePath = basePath }; ExceptionFactory = SegApiClient.Client.Configuration.DefaultExceptionFactory; _refitWrapper = refitWrapper; }
public EventBus(IInternalEventDispatcher internalEventDispatcher, IBusClient busClient, IEventSource eventSource, IApiCaller apiCaller, IApplicant applicant) { Applicant = applicant; _internalEventDispatcher = internalEventDispatcher; _rabbitBusClient = busClient; _eventSource = eventSource; _apiCaller = apiCaller; }
public void ExecuteAsync_Should_Call_Api() { var apiRequest = new ApiRequest(Method.GET) { Uri = new Uri("https://reqres.in/api/users/2"), }; IApiCaller apiCaller = GetApiCaller(); var response = AsyncHelper.RunSync(() => apiCaller.ExecuteAsync(apiRequest)); Assert.NotNull(response); }
public void Execute_Should_Call_Api_And_Return_Null_When_Http_Response_Is_Failure() { var apiRequest = new ApiRequest(Method.GET) { Uri = new Uri("https://reqres.in/api/unknown/23"), }; IApiCaller apiCaller = GetApiCaller(); var response = apiCaller.Execute <ReqResApiResponse>(apiRequest); Assert.Null(response); }
public void Execute_Should_Call_Api_And_Return_Null_When_Json_Is_Not_In_Proper_Format() { var apiRequest = new ApiRequest(Method.GET) { Uri = new Uri("https://reqres.in/api/users/2"), }; IApiCaller apiCaller = GetApiCaller(); var response = apiCaller.Execute <List <User> >(apiRequest); Assert.Null(response); }
public void ExecuteAsync_Should_Return_Null_For_Invalid_URI_In_ApiRequest() { var apiRequest = new ApiRequest(Method.GET) { Uri = new Uri("http://r.in/api/users/2"), }; IApiCaller apiCaller = GetApiCaller(); var response = AsyncHelper.RunSync(() => apiCaller.ExecuteAsync(apiRequest)); Assert.Null(response); }
private void Button_Click(object sender, RoutedEventArgs e) { var url = ConfigurationManager.AppSettings.Get("ServiceUrl"); _apiCaller = new FrontEnd.ApiCaller.ApiCaller(url); var element = new RegionViewModel { Description = txtDescription.Text, Name = txtName.Text }; var result = _apiCaller.PostServiceResponse <RegionViewModel>("Region", element); }
public void Execute_Should_Call_Api_And_Return_Deserialized_Response() { var apiRequest = new ApiRequest(Method.GET) { Uri = new Uri("https://reqres.in/api/users/2"), }; IApiCaller apiCaller = GetApiCaller(); var response = apiCaller.Execute <ReqResApiResponse>(apiRequest); Assert.NotNull(response); Assert.NotNull(response.User); Assert.Equal(2, response.User.Id); }
/// <summary> /// Initializes a new instance of the <see cref="CheckTypeApi"/> class /// using Configuration object /// </summary> /// <param name="configuration">An instance of Configuration</param> /// <returns></returns> public CheckTypeApi(IApiCaller refitWrapper, SegApiClient.Client.Configuration configuration = null) { if (configuration == null) // use the default one in Configuration { this.Configuration = SegApiClient.Client.Configuration.Default; } else { this.Configuration = configuration; } ExceptionFactory = SegApiClient.Client.Configuration.DefaultExceptionFactory; _refitWrapper = refitWrapper; }
public void Setup() { //override it with required data (local or prodcution) _data = BoardControllerTestData.GetDataExamples(); _caller = new ApiCaller(BoardControllerTestData.GetDataExamples()); }
public SomeClass(IApiCaller apiCaller) { _apiCaller = apiCaller; }
internal ContactFilterContext(IApiCaller api) : base(api) { }
public SalarioRepository(IApiCaller apiCaller) : base(apiCaller) { }
public HomeController( IApiCaller apiCaller ) { _apiCaller = apiCaller; }
internal ContactAttributeContext(IApiCaller api) : base(api) { }
internal ChannelContext(IApiCaller api) : base(api) { }
public ApiRequest WithCaller(IApiCaller apiCaller) { this.ApiCaller = apiCaller; return(this); }
public ProductSorter(IApiCaller apiCaller) { _apiCaller = apiCaller; }
internal static Mock <IApiCaller> GetApiCaller <T>(IApiCaller innerApiCaller = null) { return(MockApiCaller.Get <T>(innerApiCaller)); }
public PostsService(IApiCaller apiCaller) { _apiCaller = apiCaller; }
public TokenService(IApiCaller apiCaller) { _apiCaller = apiCaller; }
internal CampaignQuestionContext(IApiCaller api) : base(api) { }
public TranscriptsApiCaller(IApiCaller caller) { Assertion.NotNull(caller); this.caller = caller; }
internal LongCodeContext(IApiCaller api) : base(api) { }
public VotesApiCaller(IApiCaller caller) { Assertion.NotNull(caller); this.caller = caller; }