Пример #1
0
 public ScmBackup(IApiCaller apiCaller, IScmValidator validator, IBackupMaker backupMaker, IConfigBackupMaker configBackupMaker)
 {
     this.apiCaller         = apiCaller;
     this.validator         = validator;
     this.backupMaker       = backupMaker;
     this.configBackupMaker = configBackupMaker;
 }
Пример #2
0
        public void ExecuteAsync_Should_Return_Null_For_Null_ApiRequest()
        {
            IApiCaller apiCaller = GetApiCaller();
            var        response  = AsyncHelper.RunSync(() => apiCaller.ExecuteAsync(null));

            Assert.Null(response);
        }
Пример #3
0
        public void Execute_Should_Return_Null_For_Null_ApiRequest()
        {
            IApiCaller apiCaller = GetApiCaller();
            var        response  = apiCaller.Execute <ReqResApiResponse>(null);

            Assert.Null(response);
        }
Пример #4
0
 public Scraper(IApiCaller apiCaller, IOptions <ApiSettings> apiSettings)
 {
     _apiSettings = apiSettings;
     _apiCaller   = apiCaller;
     makelaarsWithPropertiesAmount           = new Dictionary <string, int>();
     makelaarsWithPropertiesWithGardenAmount = new Dictionary <string, int>();
 }
Пример #5
0
 internal Nets(string merchantId, string token, IApiCaller caller, IEndpoints endpoints)
 {
     this._merchantId = merchantId;
     this._token      = token;
     this._caller     = caller;
     this._endpoints  = endpoints;
 }
Пример #6
0
 public PrivatePageController(
     IApiCaller apiCaller,
     IHostingEnvironment environment
     )
 {
     _apiCaller   = apiCaller;
     _environment = environment;
 }
Пример #7
0
 public MovieController(
     HttpClient httpClient,
     AbstractResponseFactory <Response> responseFactory,
     IApiCaller apiCaller)
 {
     _httpClient      = httpClient;
     _responseFactory = responseFactory;
     _apiCaller       = apiCaller;
 }
Пример #8
0
        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);
        }
Пример #9
0
        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;
        }
Пример #10
0
        /// <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;
        }
Пример #11
0
        public EventBus(IInternalEventDispatcher internalEventDispatcher, IBusClient busClient,
                        IEventSource eventSource, IApiCaller apiCaller, IApplicant applicant)
        {
            Applicant = applicant;

            _internalEventDispatcher = internalEventDispatcher;
            _rabbitBusClient         = busClient;
            _eventSource             = eventSource;
            _apiCaller = apiCaller;
        }
Пример #12
0
        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);
        }
Пример #13
0
        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);
        }
Пример #14
0
        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);
        }
Пример #15
0
        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);
        }
Пример #16
0
        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);
        }
Пример #17
0
        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);
        }
Пример #18
0
        /// <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;
        }
Пример #19
0
 public void Setup()
 {
     //override it with required data (local or prodcution)
     _data   = BoardControllerTestData.GetDataExamples();
     _caller = new ApiCaller(BoardControllerTestData.GetDataExamples());
 }
Пример #20
0
 public SomeClass(IApiCaller apiCaller)
 {
     _apiCaller = apiCaller;
 }
 internal ContactFilterContext(IApiCaller api) : base(api)
 {
 }
Пример #22
0
 public SalarioRepository(IApiCaller apiCaller)
     : base(apiCaller)
 {
 }
Пример #23
0
 public HomeController(
     IApiCaller apiCaller
     )
 {
     _apiCaller = apiCaller;
 }
 internal ContactAttributeContext(IApiCaller api) : base(api)
 {
 }
Пример #25
0
 internal ChannelContext(IApiCaller api) : base(api)
 {
 }
Пример #26
0
 public ApiRequest WithCaller(IApiCaller apiCaller)
 {
     this.ApiCaller = apiCaller;
     return(this);
 }
Пример #27
0
 public ProductSorter(IApiCaller apiCaller)
 {
     _apiCaller = apiCaller;
 }
Пример #28
0
 internal static Mock <IApiCaller> GetApiCaller <T>(IApiCaller innerApiCaller = null)
 {
     return(MockApiCaller.Get <T>(innerApiCaller));
 }
Пример #29
0
 public void Setup()
 {
     //override it with required data (local or prodcution)
     _data = BoardControllerTestData.GetDataExamples();
     _caller = new ApiCaller(BoardControllerTestData.GetDataExamples());
 }
Пример #30
0
 public PostsService(IApiCaller apiCaller)
 {
     _apiCaller = apiCaller;
 }
Пример #31
0
 public TokenService(IApiCaller apiCaller)
 {
     _apiCaller = apiCaller;
 }
 internal CampaignQuestionContext(IApiCaller api) : base(api)
 {
 }
    public TranscriptsApiCaller(IApiCaller caller)
    {
      Assertion.NotNull(caller);

      this.caller = caller;
    }
Пример #34
0
 internal LongCodeContext(IApiCaller api) : base(api)
 {
 }
Пример #35
0
    public VotesApiCaller(IApiCaller caller)
    {
      Assertion.NotNull(caller);

      this.caller = caller;
    }