public ReceiptController(IReceiptService receiptService, IOrderService orderService, IProductService productService, IDeliveryService deliveryService) { this.receiptService = receiptService; this.orderService = orderService; this.productService = productService; this.deliveryService = deliveryService; }
public async Task GetAllByRecipientId_WithCorrectData_ShouldReturnCorrectResults() { string errorMessagePrefix = "ReceiptService GetAllByRecipient() method does not work properly."; var context = StopifyDbContextInMemoryFactory.InitializeContext(); #region Dummy Data context.Users.Add(new StopifyUser()); await context.SaveChangesAsync(); context.Receipts.Add(new Receipt { IssuedOn = DateTime.UtcNow.AddDays(10), Recipient = context.Users.First() }); context.Receipts.Add(new Receipt { IssuedOn = DateTime.UtcNow.AddDays(5), Recipient = context.Users.First() }); await context.SaveChangesAsync(); #endregion this.receiptService = new ReceiptService(context, new OrderService(context)); string testId = context.Users.First().Id; List <ReceiptServiceModel> actualResults = await this.receiptService.GetAllByRecipientId(testId).ToListAsync(); Assert.True(actualResults.Count == 2, errorMessagePrefix); }
public EditModel(IReceiptService service, IMapper mapper, IStaffService serviceStaff, ICustomerService serviceCustomer) { _mapper = mapper; _service = service; _serviceStaff = serviceStaff; _serviceCustomer = serviceCustomer; }
public ImageUploadController(IItemManager itemManager, IReceiptService receiptService, IAuthenticationService authenticationService) { _itemManager = itemManager; _receiptService = receiptService; _authenticationService = authenticationService; }
public MainScreen(ReceiptService receiptService) { _receiptService = receiptService; _photoImageGetter = new PhotoImageGetter(); _fileImageGetter = new FileImageGetter(); InitializeComponent(); }
public UsersController(IUserService userService, IValidator validator, IProductService productService, IReceiptService receiptService) { this.userService = userService; this.validator = validator; this.productService = productService; this.receiptService = receiptService; }
public ReceiptController(IRepository <Receipt> receiptRepository, IRepository <ReceiptItem> receiptItemRepository, IRepository <Item> itemRepository, IReceiptService receiptService, IStoreService storeService, IAutoNumberService autoNumberService, IItemService itemService, IUnitConversionService unitConversionService, IDateTimeHelper dateTimeHelper, ILocalizationService localizationService, IPermissionService permissionService, HttpContextBase httpContext, IWorkContext workContext, IDbContext dbContext) { this._receiptRepository = receiptRepository; this._receiptItemRepository = receiptItemRepository; this._itemRepository = itemRepository; this._localizationService = localizationService; this._receiptService = receiptService; this._storeService = storeService; this._autoNumberService = autoNumberService; this._itemService = itemService; this._unitConversionService = unitConversionService; this._dateTimeHelper = dateTimeHelper; this._permissionService = permissionService; this._httpContext = httpContext; this._workContext = workContext; this._dbContext = dbContext; }
public void SetUp() { var builder = new ConfigurationBuilder(). SetBasePath(Directory.GetCurrentDirectory()). AddJsonFile("appsettings.json"); Configuration = builder.Build(); var serviceCollection = new ServiceCollection(); serviceCollection.AddDbContext <ProductContext>(options => options.UseSqlServer(Configuration.GetConnectionString("ProductContext"))); serviceCollection.AddScoped <ICalculateProductPrice, CalculateProductPrice>(); serviceCollection.AddScoped <IReceiptService, ReceiptService>(); serviceCollection.AddScoped <IRegisterService, RegisterService>(); serviceCollection.AddScoped <IProductService, ProductService>(); serviceCollection.AddScoped <ISupplyService, SupplyService>(); serviceCollection.AddScoped <IMapperService, MapperService>(); var serviceProvider = serviceCollection.BuildServiceProvider(); CalculateProductPrice = serviceProvider.GetService <ICalculateProductPrice>(); ReceiptService = serviceProvider.GetService <IReceiptService>(); RegisterService = serviceProvider.GetService <IRegisterService>(); ProductService = serviceProvider.GetService <IProductService>(); SupplyService = serviceProvider.GetService <ISupplyService>(); }
public async Task GetAllItems_WithDummData_ShouldReturnCorrectResults() { string errorMessagePrefix = "ItemService GetAllItems does not work properly."; var context = AuctionDbContextInMemory.InitializeContext(); await SeedData(context); this.userService = new UserService(context); this.receiptService = new ReceiptService(context); this.cloudinaryService = new CloudinaryService(cloudinaryUtility); this.itemService = new ItemService(context, cloudinaryService, userService, receiptService); List <Item> actualResults = await this.itemService.GetAllItems().ToListAsync(); List <Item> expectedResults = GetDummyData(); for (int i = 0; i < expectedResults.Count; i++) { var expectedEntry = expectedResults[i]; var actualEntry = actualResults[i]; Assert.True(expectedEntry.Name == actualEntry.Name, errorMessagePrefix + "Names are different."); Assert.True(expectedEntry.Description == actualEntry.Description, errorMessagePrefix + "Descriptions are different."); Assert.True(expectedEntry.StartingPrice == actualEntry.StartingPrice, errorMessagePrefix + "Starting prices are different."); Assert.True(expectedEntry.BuyOutPrice == actualEntry.BuyOutPrice, errorMessagePrefix + "Buy out prices are different."); } }
public MessagesMainHandler( IMessageHandler[] messageHandlers, IMoneyOperationService moneyOperationService, IBillingPeriodService billingPeriodService, IReceiptService receiptService, IMenuProvider menuProvider, IMessenger messenger, ILogger logger) { if (messageHandlers == null) { throw new ArgumentNullException(nameof(messageHandlers)); } _moneyOperationService = moneyOperationService ?? throw new ArgumentNullException(nameof(moneyOperationService)); _billingPeriodService = billingPeriodService ?? throw new ArgumentNullException(nameof(billingPeriodService)); _receiptService = receiptService ?? throw new ArgumentNullException(nameof(receiptService)); _menuProvider = menuProvider ?? throw new ArgumentNullException(nameof(menuProvider)); _messenger = messenger ?? throw new ArgumentNullException(nameof(messenger)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _messenger.OnMessage += OnMessage; _messageHandlersMap = messageHandlers .GroupBy(x => x.MessageType) .ToDictionary(x => x.Key, x => x.ToArray()); }
/// <summary> /// constructor for Receipt controller /// </summary> /// <param name="receiptService"></param> /// <param name="logger"></param> public ReceiptController( IReceiptService receiptService, ILogger <ReceiptController> logger) { _logger = new CustomLogger <ReceiptController>(logger); _service = (ReceiptService)receiptService; }
public ReceiptController(ICustomerService customerService, IReceiptService receiptService, IInvoiceService invoiceService, IDataAccess dataAccess) { this.customerService = customerService; this.receiptService = receiptService; this.invoiceService = invoiceService; this.dataAccess = dataAccess; }
public ReceiptController(IChachedReceiptService receiptService) { this.receiptService = receiptService; ReceiptsPriceMaxValue = receiptService.GetReceiptsMaxValue(); ReceiptsTransactionMethods = receiptService.GetReceiptsMethods(); ReceiptsStoredYears = receiptService.GetReceiptsYears(); }
public async Task Buy_WithCorrectId_ShouldReturnCorrectResults() { string errorMessagePrefix = "ItemService Buy() does not work properly."; var context = AuctionDbContextInMemory.InitializeContext(); await SeedData(context); this.userService = new UserService(context); this.receiptService = new ReceiptService(context); this.cloudinaryService = new CloudinaryService(cloudinaryUtility); this.itemService = new ItemService(context, cloudinaryService, userService, receiptService); var dummyItemId = "EyePatchId"; var dummyUser = new AuctionUser { Id = "Hugo" }; context.Users.Add(dummyUser); bool actualResult = await this.itemService.Buy(dummyItemId, dummyUser.Id); Assert.True(actualResult, errorMessagePrefix); }
public ReceiptController( IGlobalService globalService, IReceiptService ReceiptService ) { this._GlobalService = globalService; this._ReceiptService = ReceiptService; }
public ReceiptController(IReceiptService receiptService, IProductService productService, UserManager <MISUser> userManger) { this.receiptService = receiptService; this.productService = productService; this.userManger = userManger; }
public PackagesController(IPackageService packageService , IUserService userService , IReceiptService receiptService) { this.packageService = packageService; this.userService = userService; this.receiptService = receiptService; }
public LivelController(IProductService productService, ICustomerService customerService, IInvoiceService invoiceService, IReceiptService receiptService, IInvoiceDetailService invoiceDetailService) { this.productService = productService; this.customerService = customerService; this.invoiceService = invoiceService; this.receiptService = receiptService; this.invoiceDetailService = invoiceDetailService; }
public FinancialController(IPaymentService paymentService, IReceiptService receiptService, IBalanceService balanceService) { _paymentService = paymentService; _receiptService = receiptService; _balanceService = balanceService; }
public ReportService(MISDbContext dbContext, ICompanyService companyService, IReceiptService receiptService) { this.dbContext = dbContext; this.companyService = companyService; this.receiptService = receiptService; }
public PackageController(IPackageService packageService, IUserService userService, IReceiptService receiptService) { _packageService = packageService; _userService = userService; _receiptService = receiptService; }
public ViewAllReceiptsPage() { InitializeComponent(); _receiptService = new ReceiptService(); receiptsList.ItemsSource = _receiptService.GetAllReceipts(); }
public ReportMessagesHandler( ICustomerService customerService, IReceiptService receiptService, IMessenger messenger) { _customerService = customerService ?? throw new ArgumentNullException(nameof(customerService)); _receiptService = receiptService ?? throw new ArgumentNullException(nameof(receiptService)); _messenger = messenger ?? throw new ArgumentNullException(nameof(messenger)); }
public PackageService( PandaDbContext db, IReceiptService receipts, UserManager <User> userManager) { this.db = db; this.receipts = receipts; this.userManager = userManager; }
/// <summary> /// /// </summary> /// <param name="env"></param> /// <param name="service"></param> /// <param name="logger"></param> /// <param name="mapper"></param> /// <param name="userManager"></param> /// <param name="config"></param> public ReceiptController(IHostingEnvironment env, IReceiptService service, ILogger <ReceiptController> logger, IMapper mapper, UserManager <UserModel> userManager, IConfiguration config) { _logger = logger; _service = service; _mapper = mapper; _userManager = userManager; _config = config; _env = env; }
public POSTerminalService() { _calculatorService = new CalculatorService(); _createProductDetailsService = new CreateProductDetailsService(); _productDiscountService = new ProductDiscountService(); _scanService = new ScanService(); _receiptService = new ReceiptService(); _paymentService = new PaymentService(_paymentProcessor); }
public ItemService(AuctionDbContext context, ICloudinaryService cloudinaryService, IUserService userService, IReceiptService receiptService) { this.context = context; this.cloudinaryService = cloudinaryService; this.userService = userService; this.receiptService = receiptService; }
public RepairTaskService(ApplicationDbContext dbContext, UserManager <User> userManager, IPartService partService, IReceiptService receiptService) { this.dbContext = dbContext; this.userManager = userManager; this.partService = partService; this.receiptService = receiptService; }
public async Task Create_WithCorrectData_ShouldReturnSuccessfullyCreate() { string errorMessagePrefix = "ItemService GetAllItems does not work properly."; var context = AuctionDbContextInMemory.InitializeContext(); await SeedData(context); this.userService = new UserService(context); this.receiptService = new ReceiptService(context); Account cloudinaryCredentials = new Account( "auction-cloud", "245777487727621", "VcLN0NRPB7qs0WZv_U2AxMR79sc"); var cloudinary = new Cloudinary(cloudinaryCredentials); this.cloudinaryService = new CloudinaryService(cloudinary); this.itemService = new ItemService(context, cloudinaryService, userService, receiptService); var user = new AuctionUser { Id = "Hugo" }; context.Users.Add(user); using (var stream = File.OpenRead(@"./Images/test.jpg")) { var file = new FormFile(stream, 0, stream.Length, null, Path.GetFileName(@"./Images/test.jpg")) { Headers = new HeaderDictionary(), ContentType = "image/jpeg" }; var dummyItem = new ItemCreateInputModel { Name = "Stick", Category = "Other", Description = "Somethin", AuctionDuration = 12, StartingPrice = 334M, BuyOutPrice = 3412M, Picture = file, AuctionHouse = "Ember" }; bool actualResult = await this.itemService.Create(dummyItem, user.Id); Assert.True(actualResult, errorMessagePrefix); } }
public ReceiptController() { service = IoC.Resolve<IReceiptService>("ReceiptService"); calendarService = IoC.Resolve<ICalendarService>("CalendarService"); sobService = IoC.Resolve<ISetOfBookService>("SetOfBookService"); customerService = IoC.Resolve<ICustomerService>("CustomerService"); customerSiteService = IoC.Resolve<ICustomerSiteService>("CustomerSiteService"); bankService = IoC.Resolve<IBankService>("BankService"); bankAccountService = IoC.Resolve<IBankAccountService>("BankAccountService"); currencyService = IoC.Resolve<ICurrencyService>("CurrencyService"); }
public ReceiptController() { service = IoC.Resolve <IReceiptService>("ReceiptService"); calendarService = IoC.Resolve <ICalendarService>("CalendarService"); sobService = IoC.Resolve <ISetOfBookService>("SetOfBookService"); customerService = IoC.Resolve <ICustomerService>("CustomerService"); customerSiteService = IoC.Resolve <ICustomerSiteService>("CustomerSiteService"); bankService = IoC.Resolve <IBankService>("BankService"); bankAccountService = IoC.Resolve <IBankAccountService>("BankAccountService"); currencyService = IoC.Resolve <ICurrencyService>("CurrencyService"); }
public ReceiptController(IReceiptService receiptService) { _receiptService = receiptService; }
static ReceiptHelper() { service = IoC.Resolve<IReceiptService>("ReceiptService"); }
public HomeController(IUserService userService, IReceiptService receiptService) { _userService = userService; _receiptService = receiptService; }
public EconomyController(IUserService userService, IReceiptService receiptService) { _userService = userService; _receiptService = receiptService; }
public HomeController(IParticipantService participants, IReceiptService receipts) { _participantservice = participants; _receiptService = receipts; }