public ApplicationService( IConfiguration configuration, IDeviceServiceFactory deviceServiceFactory, IReceiverService receiverService ) { _configuration = configuration; _deviceServiceFactory = deviceServiceFactory; var clientId = _configuration["MqttOptions:ClientId"]; var cseId = _configuration["MqttOptions:CSEId"]; var broker = _configuration["MqttOptions:Broker"]; var port = Convert.ToInt32(_configuration["MqttOptions:Port"]); var timeout = Convert.ToInt32(_configuration["MqttOptions:Timeout"]); var username = _configuration["MqttOptions:Username"]; var password = _configuration["MqttOptions:Password"]; _deviceClientOptions = new DeviceClientOptionsBuilder() .WithClientId(clientId) .WithCSEId(cseId) .WithMqttOptions(broker, port, timeout, username, password) .Build(); _deviceService = _deviceServiceFactory.CreateDeviceService(_deviceClientOptions); _receiverService = receiverService; }
public void GetReceiverById_works_Properly() { string errorMessagePrefix = "ReceiverService GetReceiverById() method does not work properly."; var context = OilsProDbContextInMemoryFactory.InitializeContext(); this.receiverService = new ReceiverService(context); var receiver = new Receiver { Name = "Receiver1", DeliveryAddresses = new List <DeliveryAddress> { new DeliveryAddress { Town = "Town1", Street = "Street1", }, new DeliveryAddress { Town = "Town2", Street = "Street2", }, } }; context.Receivers.Add(receiver); context.SaveChanges(); var result = receiverService.GetReceiverById(receiver.Id); var expected = receiver; Assert.AreEqual(expected, result, errorMessagePrefix); }
public TelegramController( ITelegramService telegram, ISessionService session, IReceiverService receiver ) { _telegram = telegram; _session = session; _receiver = receiver; }
public BookingController(IUnitOfWork unitOfWork, DataContext context, IBookingService bookingService, IStatusService statusService, IMerchantService merchantService, IReceiverService receiverService, ILogger <BookingController> logger) { _context = context; _unitOfWork = unitOfWork; _bookingService = bookingService; _statusService = statusService; _merchantService = merchantService; _receiverService = receiverService; _logger = logger; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IReceiverService receiverService) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } //receiverService.Receive(); app.UseHttpsRedirection(); app.UseMvc(); }
public void DeleteAddress_works_Properly() { string errorMessagePrefix = "ReceiverService DeleteAddress() method does not work properly."; var context = OilsProDbContextInMemoryFactory.InitializeContext(); this.receiverService = new ReceiverService(context); var address = new DeliveryAddress() { Town = "Town1", }; context.DeliveryAddresses.Add(address); context.SaveChanges(); var result = receiverService.DeleteAddress(address.Id); Assert.True(result.isDeleted); }
public void Delete_works_Properly() { string errorMessagePrefix = "ReceiverService Delete() method does not work properly."; var context = OilsProDbContextInMemoryFactory.InitializeContext(); this.receiverService = new ReceiverService(context); var receiver = new Receiver { Name = "Receiver1", }; context.Receivers.Add(receiver); context.SaveChanges(); var result = receiverService.Delete(receiver.Id); Assert.True(result.isDeleted); }
public void CreateNewAddress_works_Properly() { string errorMessagePrefix = "ReceiverService CreateNewAddress() method does not work properly."; var context = OilsProDbContextInMemoryFactory.InitializeContext(); this.receiverService = new ReceiverService(context); var receiver = new Receiver { Name = "Receiver1", }; context.Receivers.Add(receiver); context.SaveChanges(); var result = receiverService.CreateNewAddress("Town1", "Street1", "Receiver1"); Assert.True(context.DeliveryAddresses.Contains(result)); }
public void EditIncludedAddress_works_Properly() { string errorMessagePrefix = "ReceiverService EditIncludedAddress() method does not work properly."; var context = OilsProDbContextInMemoryFactory.InitializeContext(); this.receiverService = new ReceiverService(context); var address = new DeliveryAddress() { Town = "Town1", Street = "Street1", }; context.DeliveryAddresses.Add(address); context.SaveChanges(); var result = receiverService.EditIncludedAddress(address.Id, "Town2", "Street2"); Assert.True(context.DeliveryAddresses.First().Town == "Town2"); Assert.True(context.DeliveryAddresses.First().Street == "Street2"); }
public NomenclaturesController(INomenclaturesService nomenclaturesService, IReceiverService receiverService, IMapper mapper) { _nomenclaturesService = nomenclaturesService; _receiverService = receiverService; _mapper = mapper; }
public GetUsersPageCountQueryHandler(IReceiverService receiverService) { _receiverService = receiverService; }
public ValuesController( IReceiverService receiverService ) { _receiverService = receiverService; }
public GetListOrganizationsQueryHandler(IReceiverService receiverService) { _receiverService = receiverService; }
public GetListUsersQueryHandler(IReceiverService receiverService) { _receiverService = receiverService; }
public CoreServiceTest() { _domainRabbitMQ = new Mock <IDomainRabbitMQ>(); _receiverService = new ReceiverService(_domainRabbitMQ.Object); _senderService = new SenderService(_domainRabbitMQ.Object); }
public AddUserOrganizationCommandHandler(IReceiverService receiverService) { _receiverService = receiverService; }
public ReceiversController(IReceiverService receiversService, IMapper mapper) { _receiversService = receiversService; _mapper = mapper; }
public BotController(ISenderService senderService, IReceiverService receiverService) { _receiverService = receiverService; _senderService = senderService; }
public Consumer(ILogger <Consumer> logger, IReceiverService receiverService) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _receiverService = receiverService ?? throw new ArgumentNullException(nameof(receiverService)); }
public ReceiversController(IReceiverService receiverService) =>
public HomeController(IReceiverService receiverService) { _receiverService = receiverService; }