コード例 #1
0
        public virtual async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            var mapper = new ApiRateServerModelMapper();
            ApplicationDbContext       context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
            IRateService               service = testServer.Host.Services.GetService(typeof(IRateService)) as IRateService;
            ApiRateServerResponseModel model   = await service.Get(1);

            ApiRateClientRequestModel request = mapper.MapServerResponseToClientRequest(model);

            request.SetProperties(2m, 1, 1);

            UpdateResponse <ApiRateClientResponseModel> updateResponse = await client.RateUpdateAsync(model.Id, request);

            context.Entry(context.Set <Rate>().ToList()[0]).Reload();
            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
            updateResponse.Record.Id.Should().Be(1);
            context.Set <Rate>().ToList()[0].AmountPerMinute.Should().Be(2m);
            context.Set <Rate>().ToList()[0].TeacherId.Should().Be(1);
            context.Set <Rate>().ToList()[0].TeacherSkillId.Should().Be(1);

            updateResponse.Record.Id.Should().Be(1);
            updateResponse.Record.AmountPerMinute.Should().Be(2m);
            updateResponse.Record.TeacherId.Should().Be(1);
            updateResponse.Record.TeacherSkillId.Should().Be(1);
        }
コード例 #2
0
        public RateController(IRateService rateService, Core.IWorkContext workContext, IHostingEnvironment env)
        {
            this._rateService = rateService;

            this._workContext = workContext;
            this._env         = env;
        }
コード例 #3
0
 public MoneyService(
     WalletContext walletContext,
     IRateService rateService)
 {
     _walletContext = walletContext;
     _rateService   = rateService;
 }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: OlegShevtsiv/PPS
 public HomeController(IBookService bookService, IAuthorService authorService, UserManager <IdentityUser> userManager, IRateService rateService)
 {
     _bookService   = bookService;
     _authorService = authorService;
     _userManager   = userManager;
     _rateService   = rateService;
 }
コード例 #5
0
 public DepartureService(IRepository <DepartureEntity> departureRepository, IRepository <EntryEntity> entryRepository, IRateService rateService, ICellService cellService)
 {
     _departureRepository = departureRepository;
     _entryRepository     = entryRepository;
     _rateService         = rateService;
     _cellService         = cellService;
 }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: OlegShevtsiv/Repo1
 public HomeController(IBookService bookService, IAuthorService authorService, IRateService rateService, IWishListService wlService)
 {
     _bookService   = bookService;
     _authorService = authorService;
     _rateService   = rateService;
     _wlService     = wlService;
 }
コード例 #7
0
ファイル: HomeController.cs プロジェクト: OlegShevtsiv/OOA
 public HomeController(IBookService bookService, IAuthorService authorService, IRateService rateService, ILibraryHttpDataClient client)
 {
     _bookService   = bookService;
     _authorService = authorService;
     _rateService   = rateService;
     _client        = client;
 }
コード例 #8
0
 public RateController()
 {
     this._rateService = new RateService();
     this._rateTypeService = new RateTypeService();
     this._accountService = new AccountService();
     this._placeService = new PlaceService();
 }
コード例 #9
0
 public ManageLibraryController(IBookService bookService, IAuthorService authorService, IRateService rateService, ICommentService commentService)
 {
     _bookService    = bookService;
     _authorService  = authorService;
     _commentService = commentService;
     _rateService    = rateService;
 }
コード例 #10
0
 public HomeController(ILogger <HomeController> logger, IRateService rateService, ITaxReport report, IOptions <SampleSettings> settingsOptions, IEmailSender emailSender)
 {
     sampleSettings   = settingsOptions.Value;
     _logger          = logger;
     this.rateService = rateService;
     //emailSender.SendEmailAsync("*****@*****.**","dasdasdas", "tjenare<br />hopp").Wait();
 }
コード例 #11
0
        public void SetUp()
        {
            //Default hits production API URL
            //_rateService = new RateService();

            //Uses test API URL by default.  Configure in app.config.
            _rateService = new RateService(Settings.Default.UspsApiUrl, new PostRequest());

            _userId        = Settings.Default.UspsUserId;
            _password      = Settings.Default.UspsPassword;
            _sourceZipCode = Settings.Default.UspsSourceZip;

            if (string.IsNullOrEmpty(_userId))
            {
                throw new Exception("You must set UspsUserId in app.config to run 'Explicit' integration tests");
            }

            if (string.IsNullOrEmpty(_password))
            {
                throw new Exception("You must set UspsPassword in app.config to run 'Explicit' integration tests");
            }

            if (string.IsNullOrEmpty(_sourceZipCode))
            {
                throw new Exception("You must set UspsSourceZip in app.config to run 'Explicit' integration tests");
            }
        }
コード例 #12
0
 public RateController(ILogger <SegmentController> logger, IConfiguration configuration, ISegmentService segmentService, IRateService rateService)
 {
     _logger         = logger;
     _configuration  = configuration;
     _segmentService = segmentService;
     _rateService    = rateService;
 }
コード例 #13
0
ファイル: RateServer.cs プロジェクト: aosrul/AbacasX
        public RateServer(IHubContext <RateServerHub> hub, IRateService rateService)
        {
            Hub          = hub;
            _rateService = rateService;

            ((RateRepository)_rateService).setTokenPairSubject(_tokenPairRateSubject);
        }
コード例 #14
0
ファイル: RateController.cs プロジェクト: ResulSilay/FlowApp
 public RateController(IRateService rateService, IPostService postService, IUserService userService, IMapper mapper)
 {
     _rateService = rateService;
     _postService = postService;
     _userService = userService;
     _mapper      = mapper;
 }
コード例 #15
0
 public OperationsController(IRepository <Transaction> TransactionsRepository, ITransactionService TransactionService, IRepository <Rate> RatesRepository, IRateService RateService)
 {
     this.transactionRep = TransactionsRepository;
     this.rateRep        = RatesRepository;
     this.transactionsvc = TransactionService;
     this.ratesvc        = RateService;
 }
コード例 #16
0
 public ClientController(
     IClientService clientService,
     IRateService rateService)
 {
     this.clientService = clientService;
     this.rateService   = rateService;
 }
 public ProductController(IProductSevice productService,
                          IProductDetailService productDetailService,
                          IProductSizeService productSizeService,
                          IProductImageService productImageService,
                          IColorService colorService,
                          IRateService rateService,
                          IReviewService reviewService,
                          IUserService userService,
                          IOrderService orderService,
                          IOrderDetailService orderDetailService,
                          ICategoryService categoryService, IMapper mapper)
 {
     _productService       = productService;
     _categoryService      = categoryService;
     _productDetailService = productDetailService;
     _productSizeService   = productSizeService;
     _productImageService  = productImageService;
     _colorService         = colorService;
     _rateService          = rateService;
     _reviewService        = reviewService;
     _userService          = userService;
     _orderService         = orderService;
     _orderDetailService   = orderDetailService;
     _mapper = mapper;
 }
コード例 #18
0
        public virtual async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);
            var        client     = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            IRateService service = testServer.Host.Services.GetService(typeof(IRateService)) as IRateService;
            var          model   = new ApiRateServerRequestModel();

            model.SetProperties(2m, 1, 1);
            CreateResponse <ApiRateServerResponseModel> createdResponse = await service.Create(model);

            createdResponse.Success.Should().BeTrue();

            ActionResponse deleteResult = await client.RateDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();
            ApiRateServerResponseModel verifyResponse = await service.Get(2);

            verifyResponse.Should().BeNull();
        }
        public ShippingSeeSharpShipUspsController(SeeSharpShipUspsSettings uspsSettings, ISettingService settingService)
        {
            _uspsSettings   = uspsSettings;
            _settingService = settingService;

            // ReSharper disable once CSharpWarnings::CS0618
            _rateService = _uspsSettings.Url == null ? new RateService() : new RateService(_uspsSettings.Url, new PostRequest());
        }
コード例 #20
0
ファイル: RatesController.cs プロジェクト: jefridev/GNB
 public RatesController(IRateService rateService,
                        IOptions <EndpointSettings> endpointSettings,
                        ILogger <IRateService> logger)
 {
     _endpointSettings = endpointSettings;
     _rateService      = rateService;
     _logger           = logger;
 }
コード例 #21
0
 public ManageLibraryController(IBookService bookService, IAuthorService authorService, IRateService rateService, ICommentService commentService, ILibraryHttpDataClient client)
 {
     _bookService    = bookService;
     _authorService  = authorService;
     _commentService = commentService;
     _client         = client;
     _rateService    = rateService;
 }
コード例 #22
0
 public RateServiceTests()
 {
     this.service = new RateService();
     service.Add(new Rate { RateInformation = "5", }
         );
     service.Add(new Rate { RateInformation = "3" }
         );
 }
コード例 #23
0
        public void SetUp()
        {
            data = DataCollection.Rates;

            var repo = MockRepository <Rate> .Initialize(data);

            rateService = new RateService(repo);
        }
コード例 #24
0
 public TrustManagementService(ApplicationDbContext context, IIpfsService ipfsService, ISmartContractService smartContractService, IStatisticService statisticService, IRateService rateService, ILogger <ITrustManagementService> logger)
 {
     this.context              = context;
     this.ipfsService          = ipfsService;
     this.smartContractService = smartContractService;
     this.statisticService     = statisticService;
     this.rateService          = rateService;
     this.logger = logger;
 }
コード例 #25
0
 public CalculationService(IRateService rateService, IDiscountDocumentService discountDocumentService,
                           IAccountService accountService, IStreetService streetService, ISearchService searchService)
 {
     _rateService             = rateService;
     _discountDocumentService = discountDocumentService;
     _accountService          = accountService;
     _streetService           = streetService;
     _searchService           = searchService;
 }
コード例 #26
0
 public RateUpdatedNotificationHandler(
     ILogger <RateUpdatedEvent> logger,
     IRateService rateService,
     IServiceBusClient serviceBusClient)
     : base(logger)
 {
     _rateService      = rateService;
     _serviceBusClient = serviceBusClient;
 }
コード例 #27
0
 public PlaceModel(ITuristPlaceService turistPlaceService,
                   ICommentService commentService,
                   UserManager <User> userManager)
 {
     this.turistPlaceService = turistPlaceService;
     this.commentService     = commentService;
     this.rateService        = rateService;
     this.userManager        = userManager;
 }
コード例 #28
0
ファイル: SollecitiService.cs プロジェクト: gipasoft/Sfera
 public SollecitiService(IRateService rateService, IVersamentiCondominiService versamentiService, IMovimentiContabiliService movimentiContabileService, IPersonaService personaService, IProtocolloService protocolloService, IEsercizioService esercizioService, IDaoFactory daofactory)
 {
     _rateService = rateService;
     _versamentiService = versamentiService;
     _movimentiContabileService = movimentiContabileService;
     _personaService = personaService;
     _protocolloService = protocolloService;
     _esercizioService = esercizioService;
     _daoFactory = daofactory;
 }
コード例 #29
0
 public VideoService(
     IDeletableEntityRepository <Video> videoRepository,
     ICommentSerivce commentSerivce,
     IRateService rateService
     )
 {
     this.videoRepository = videoRepository;
     this.commentSerivce  = commentSerivce;
     this.rateService     = rateService;
 }
コード例 #30
0
 public UpdateRateCommonHandler(
     IValidator <UpdateRateCommand> validator,
     ILogger <UpdateRateCommand> logger,
     IMapper mapper,
     IRateService rateService)
     : base(validator, logger)
 {
     _mapper      = mapper;
     _rateService = rateService;
 }
コード例 #31
0
 public TransactionService(
     IRepository <Transaction> TransactionRepository,
     IResourceClient <Transaction> TransactionClient,
     IRateService RateService,
     LogFactory Factory)
 {
     this._TransactionRepository = TransactionRepository;
     this._TransactionClient     = TransactionClient;
     this._RateService           = RateService;
     this._Logger = Factory.GetCurrentClassLogger();
 }
コード例 #32
0
 public RateServiceTests()
 {
     this.service = new RateService();
     service.Add(new Rate {
         RateInformation = "5",
     }
                 );
     service.Add(new Rate {
         RateInformation = "3"
     }
                 );
 }
コード例 #33
0
ファイル: HomeController.cs プロジェクト: Cravvley/Compareo
 public HomeController(IProductService productService, IReportService reportService, IRateService rateService,
                       ICommentService commentService, IShopPropositionService shopPropositionService, IProductPropositionService productPropositionService,
                       IShopService shopService)
 {
     _productService            = productService;
     _reportService             = reportService;
     _rateService               = rateService;
     _commentService            = commentService;
     _shopPropositionService    = shopPropositionService;
     _productPropositionService = productPropositionService;
     _shopService               = shopService;
 }
コード例 #34
0
ファイル: SubentroService.cs プロジェクト: gipasoft/Sfera
 public SubentroService(IBilancioService bilancioService, IRateService rateService, IPersonaService personaService, ISoggettoService soggettoService, IRipartizioneSpeseService ripartizioneSpeseService, ISaldoContabileService saldoContabileService, IVersamentiCondominiService versamentiCondominiService, IPianoContiService pianoContiService, ISaldiCondominiService saldiCondominiService, IPersistenceContext persistenceContext, IDaoFactory daofactory)
 {
     _bilancioService = bilancioService;
     _daoFactory = daofactory;
     _rateService = rateService;
     _personaService = personaService;
     _soggettoService = soggettoService;
     _ripartizioneSpeseService = ripartizioneSpeseService;
     _saldoContabileService = saldoContabileService;
     _versamentiCondominiService = versamentiCondominiService;
     _pianoContiService = pianoContiService;
     _saldiCondominiService = saldiCondominiService;
     _persistenceContext = persistenceContext;
 }
コード例 #35
0
        /// <summary>
        /// Counstruts example of <see cref="ExchangeRates"/>
        /// </summary>
        /// <param name="sessionFactory">Factory of datasource-sessions</param>
        /// <param name="rateRepository">Repository of cached rates</param>
        /// <param name="rateService">Rate remote service</param>
        /// <exception cref="ArgumentNullException"/>
        public ExchangeRates(ISessionFactory sessionFactory, IRateRepository rateRepository, IRateService rateService)
        {
            if (sessionFactory == null)
                throw new ArgumentNullException("sessionFactory");
            if (rateRepository == null)
                throw new ArgumentNullException("rateRepository");
            if (rateService == null)
                throw new ArgumentNullException("rateService");

            ErrorMessage = string.Empty;
            _sessionFactory = sessionFactory;
            _rateRepository = rateRepository;
            _rateService = rateService;
        }
コード例 #36
0
        private readonly TimeSpan _updatedPeriod = new TimeSpan(0, 0, 30, 0); // 30 minutes

        #endregion Fields

        #region Constructors

        public CurrencyService(IRateService rateService)
        {
            _rateService = rateService;
        }
コード例 #37
0
ファイル: RoomTypeService.cs プロジェクト: mkhj/EcoHotels
        public RoomTypeService(IRateService rateService)
        {
            RateService = rateService;

            RoomTypeRepo = new Repository<RoomType>();
        }
コード例 #38
0
 public RateCommand(ILogger logger, IRateService rateService)
 {
     this.logger = logger;
     this.rateService = rateService;
 }