public void Arrange()
        {
            _expectedResevationRules = new List <ReservationRule>
            {
                new ReservationRule()
            };

            _expectedGlobalRules = new List <GlobalRule>
            {
                new GlobalRule()
            };

            _apiClient = new Mock <IApiClient>();
            _apiClient.Setup(x =>
                             x.Get <GetFundingRulesApiResponse>(
                                 It.Is <GetFundingRulesApiRequest>(c =>
                                                                   c.GetUrl.Equals(
                                                                       $"{ExpectedBaseUrl}api/rules"))))
            .ReturnsAsync(new GetFundingRulesApiResponse
            {
                Rules       = _expectedResevationRules,
                GlobalRules = _expectedGlobalRules
            });

            _options = new Mock <IOptions <ReservationsApiConfiguration> >();
            _options.Setup(x => x.Value.Url).Returns(ExpectedBaseUrl);

            _service = new FundingRulesService(_apiClient.Object, _options.Object);
        }
Example #2
0
        public void Arrange()
        {
            var fixture = new Fixture();

            _accountLegalEntityId   = fixture.Create <long>();
            _expectedAvailableDates = fixture.Create <List <TrainingDateModel> >();

            _apiClient = new Mock <IApiClient>();
            _apiClient.Setup(x =>
                             x.Get <GetAvailableDatesApiResponse>(
                                 It.Is <GetAvailableDatesApiRequest>(c =>
                                                                     c.GetUrl.Equals(
                                                                         $"{ExpectedBaseUrl}api/rules/available-dates/{_accountLegalEntityId}"))))
            .ReturnsAsync(new GetAvailableDatesApiResponse
            {
                AvailableDates = _expectedAvailableDates
            });

            _options = new Mock <IOptions <ReservationsApiConfiguration> >();
            _options
            .Setup(x => x.Value.Url)
            .Returns(ExpectedBaseUrl);

            _service = new FundingRulesService(_apiClient.Object, _options.Object);
        }
Example #3
0
        public void Arrange()
        {
            _apiClient = new Mock <IApiClient>();
            _apiClient.Setup(x =>
                             x.Create <bool>(It.Is <MarkRuleAsReadApiRequest>(c =>
                                                                              c.CreateUrl.Equals(
                                                                                  $"{ExpectedBaseUrl}api/rules"))));

            _options = new Mock <IOptions <ReservationsApiConfiguration> >();
            _options.Setup(x => x.Value.Url).Returns(ExpectedBaseUrl);

            _service = new FundingRulesService(_apiClient.Object, _options.Object);
        }
 public GetFundingRulesQueryHandler(IFundingRulesService service)
 {
     _service = service;
 }
 public CacheReservationEmployerCommandValidator(IFundingRulesService rulesService, IMediator mediator)
 {
     _rulesService = rulesService;
     _mediator     = mediator;
 }
Example #6
0
 public MarkRuleAsReadCommandHandler(IFundingRulesService service, IValidator <MarkRuleAsReadCommand> validator)
 {
     _service   = service;
     _validator = validator;
 }
Example #7
0
 public GetAccountFundingRulesQueryHandler(IFundingRulesService fundingRulesService,
                                           IValidator <GetAccountFundingRulesQuery> validator)
 {
     _fundingRulesService = fundingRulesService;
     _validator           = validator;
 }
 public GetAvailableDatesQueryHandler(IFundingRulesService fundingRulesService)
 {
     _fundingRulesService = fundingRulesService;
 }
Example #9
0
 public GetNextUnreadGlobalFundingRuleQueryHandler(IFundingRulesService service)
 {
     _service = service;
 }