Пример #1
0
        public TeamManagementController()
        {
            var apiClient = new ApiClient(HttpClientInstance.Instance);

            _teamManagementClient = new TeamManagementClient(apiClient);
            _countryClient        = new CountryClient(apiClient);
        }
Пример #2
0
        public CountryClientTests()
        {
            var mockConfig = Substitute.For <IOptions <Config> >();

            mockConfig.Value.Returns <Config>(new Config()
            {
                CountryApi = "https://restcountries.eu/rest/v2/all"
            });
            _countryClient = new CountryClient(Substitute.For <HttpClient>(), mockConfig);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReferenceDataClientRepository" /> class.
 /// </summary>
 /// <param name="applicationSettings">The application settings.</param>
 public ReferenceDataClientRepository(IApplicationSettings applicationSettings)
 {
     if (applicationSettings != null)
     {
         this.countryClient = DIContainer.Instance.Resolve<ICountryClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.ReferenceDataServiceBaseAddress) });
         this.personTypeClient = DIContainer.Instance.Resolve<IPersonTypeClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.ReferenceDataServiceBaseAddress) });
         this.documentTypeClient = DIContainer.Instance.Resolve<IDocumentTypeClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.ReferenceDataServiceBaseAddress) });
         this.loyaltyLevelTypeClient = DIContainer.Instance.Resolve<ILoyaltyLevelTypeClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.ReferenceDataServiceBaseAddress) });
         this.portClient = DIContainer.Instance.Resolve<IPortClient>(new ResolverOverride[] { new ParameterOverride(BaseAddressParameterName, applicationSettings.ReferenceDataServiceBaseAddress) });
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicantValidator"/> class.
        /// </summary>
        public ApplicantValidator(ICountryClient client, IStringLocalizer <ApplicantWDTO> localizer)
        {
            this.client = client;

            RuleFor(x => x.Hired).NotNull();
            RuleFor(x => x.Name).NotNull().Length(5, 50);
            RuleFor(x => x.FamilyName).NotNull().Length(5, 50);
            RuleFor(x => x.Address).Length(10, 50);
            RuleFor(x => x.EmailAddress).NotNull().Matches(@"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$");
            RuleFor(x => x.Age).NotNull().InclusiveBetween(20, 60);
            RuleFor(x => x.CountryOforigin).Must(isCountryValid).WithMessage(x => localizer["Invalid country provided"]);
        }
Пример #5
0
 public App(IConfiguration config, IConsole console,
            ICountryClient countryClient,
            IInitialAppClient initialAppClient,
            ILoginClient loginClient,
            IBatteryStatusClient batteryStatusClient)
 {
     _config              = config;
     _console             = console;
     _countryClient       = countryClient;
     _initialAppClient    = initialAppClient;
     _loginClient         = loginClient;
     _batteryStatusClient = batteryStatusClient;
 }
 public PaymentsenseCodingChallengeController(ICountryClient countryClient)
 {
     _countryClient = countryClient;
 }
Пример #7
0
 public CountryService(ICountryClient countryClient, ICacheProvider cacheProvider)
 {
     _countryClient = countryClient ?? throw new ArgumentNullException(nameof(countryClient));
     _cacheProvider = cacheProvider ?? throw new ArgumentNullException(nameof(cacheProvider));
 }
Пример #8
0
 public CountryRepository(ICountryClient countryClient, ICacheService cacheService)
 {
     _countryClient = countryClient;
     _cacheService  = cacheService;
 }