public PriceCalculationService(IWorkContext workContext, IStoreContext storeContext, IDiscountService discountService, ICategoryService categoryService, IManufacturerService manufacturerService, IProductAttributeParser productAttributeParser, IProductService productService, ICustomerProductService customerProductService, IVendorService vendorService, ICurrencyService currencyService, ShoppingCartSettings shoppingCartSettings, CatalogSettings catalogSettings) { _workContext = workContext; _storeContext = storeContext; _discountService = discountService; _categoryService = categoryService; _manufacturerService = manufacturerService; _productAttributeParser = productAttributeParser; _productService = productService; _customerProductService = customerProductService; _vendorService = vendorService; _currencyService = currencyService; _shoppingCartSettings = shoppingCartSettings; _catalogSettings = catalogSettings; }
public void TestInitialize() { tempWorkContext = new Mock <IWorkContext>(); { _workContext = tempWorkContext.Object; } var tempStoreContext = new Mock <IStoreContext>(); { _store = new Store { Id = "1" }; tempStoreContext.Setup(instance => instance.CurrentStore).Returns(_store); _storeContext = tempStoreContext.Object; } tempDiscountServiceMock = new Mock <IDiscountService>(); { _discountService = tempDiscountServiceMock.Object; } _categoryService = new Mock <ICategoryService>().Object; _manufacturerService = new Mock <IManufacturerService>().Object; _vendorService = new Mock <IVendorService>().Object; _customerService = new Mock <ICustomerService>().Object; _currencyService = new Mock <ICurrencyService>().Object; tempProductService = new Mock <IProductService>(); { _productService = tempProductService.Object; } _productAttributeParser = new Mock <IProductAttributeParser>().Object; _shoppingCartSettings = new ShoppingCartSettings(); _catalogSettings = new CatalogSettings(); _customerProductService = new Mock <ICustomerProductService>().Object; var eventPublisher = new Mock <IMediator>(); _eventPublisher = eventPublisher.Object; _priceCalcService = new PriceCalculationService( _workContext, _storeContext, _discountService, _categoryService, _manufacturerService, _productAttributeParser, _productService, _customerProductService, _vendorService, _currencyService, _shoppingCartSettings, _catalogSettings); }
public void TestInitialize() { new Grand.Services.Tests.ServiceTest().PluginInitializator(); _workContext = new Mock <IWorkContext>().Object; _stateProvinceService = new Mock <IStateProvinceService>().Object; _store = new Store { Id = "1" }; var tempStoreContext = new Mock <IStoreContext>(); { tempStoreContext.Setup(x => x.CurrentStore).Returns(_store); _storeContext = tempStoreContext.Object; } _productService = new Mock <IProductService>().Object; var tempEventPublisher = new Mock <IMediator>(); { //tempEventPublisher.Setup(x => x.PublishAsync(It.IsAny<object>())); _eventPublisher = tempEventPublisher.Object; } var pluginFinder = new PluginFinder(_serviceProvider); var cacheManager = new TestMemoryCacheManager(new Mock <IMemoryCache>().Object, _eventPublisher); _discountService = new Mock <IDiscountService>().Object; _categoryService = new Mock <ICategoryService>().Object; _manufacturerService = new Mock <IManufacturerService>().Object; _productAttributeParser = new Mock <IProductAttributeParser>().Object; _vendorService = new Mock <IVendorService>().Object; _currencyService = new Mock <ICurrencyService>().Object; _serviceProvider = new Mock <IServiceProvider>().Object; _shoppingCartSettings = new ShoppingCartSettings(); _catalogSettings = new CatalogSettings(); _customerService = new Mock <ICustomerService>().Object; _customerProductService = new Mock <ICustomerProductService>().Object; _priceCalcService = new PriceCalculationService(_workContext, _storeContext, _discountService, _categoryService, _manufacturerService, _productAttributeParser, _productService, _customerProductService, _vendorService, _currencyService, _shoppingCartSettings, _catalogSettings); _localizationService = new Mock <ILocalizationService>().Object; //shipping _shippingSettings = new ShippingSettings(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); _shippingMethodRepository = new Mock <IRepository <ShippingMethod> >().Object; _deliveryDateRepository = new Mock <IRepository <DeliveryDate> >().Object; _warehouseRepository = new Mock <IRepository <Warehouse> >().Object; _logger = new NullLogger(); _paymentService = new Mock <IPaymentService>().Object; _checkoutAttributeParser = new Mock <ICheckoutAttributeParser>().Object; _giftCardService = new Mock <IGiftCardService>().Object; _genericAttributeService = new Mock <IGenericAttributeService>().Object; _geoLookupService = new Mock <IGeoLookupService>().Object; _countryService = new Mock <ICountryService>().Object; _customerSettings = new CustomerSettings(); _addressSettings = new AddressSettings(); //tax _taxSettings = new TaxSettings(); _taxSettings.ShippingIsTaxable = true; _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; _taxSettings.DefaultTaxAddressId = "10"; _shippingService = new ShippingService(_shippingMethodRepository, _deliveryDateRepository, _warehouseRepository, null, _logger, _productService, _productAttributeParser, _checkoutAttributeParser, _localizationService, _addressService, _countryService, _stateProvinceService, pluginFinder, _eventPublisher, _currencyService, cacheManager, _shoppingCartSettings, _shippingSettings); var tempAddressService = new Mock <IAddressService>(); { tempAddressService.Setup(x => x.GetAddressByIdSettings(_taxSettings.DefaultTaxAddressId)) .ReturnsAsync(new Address { Id = _taxSettings.DefaultTaxAddressId }); _addressService = tempAddressService.Object; } _taxService = new TaxService(_addressService, _workContext, pluginFinder, _geoLookupService, _countryService, _logger, _taxSettings, _customerSettings, _addressSettings); _rewardPointsSettings = new RewardPointsSettings(); _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, _priceCalcService, _taxService, _shippingService, _paymentService, _checkoutAttributeParser, _discountService, _giftCardService, null, _productService, _currencyService, _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings); }
public void TestInitialize() { tempWorkContext = new Mock <IWorkContext>(); { tempWorkContext.Setup(instance => instance.WorkingCurrency).Returns(_currency); _workContext = tempWorkContext.Object; } var tempStoreContext = new Mock <IStoreContext>(); { _store = new Store { Id = "1" }; tempStoreContext.Setup(instance => instance.CurrentStore).Returns(_store); _storeContext = tempStoreContext.Object; } tempDiscountServiceMock = new Mock <IDiscountService>(); { _discountService = tempDiscountServiceMock.Object; } _categoryService = new Mock <ICategoryService>().Object; _manufacturerService = new Mock <IManufacturerService>().Object; _vendorService = new Mock <IVendorService>().Object; _customerService = new Mock <ICustomerService>().Object; tempProductService = new Mock <IProductService>(); { _productService = tempProductService.Object; } _productAttributeParser = new Mock <IProductAttributeParser>().Object; _shoppingCartSettings = new ShoppingCartSettings(); _catalogSettings = new CatalogSettings(); _customerProductService = new Mock <ICustomerProductService>().Object; var eventPublisher = new Mock <IMediator>(); _eventPublisher = eventPublisher.Object; _currencySettings = new CurrencySettings(); _currencySettings.PrimaryExchangeRateCurrencyId = "1"; _currencySettings.PrimaryStoreCurrencyId = "1"; //_currencyService = new Mock<ICurrencyService>().Object; _currency = new Currency { Id = "1", CurrencyCode = "USD", Rate = 1, Published = true, MidpointRound = System.MidpointRounding.ToEven, RoundingType = RoundingType.Rounding001 }; var tempCurrency = new Mock <ICurrencyService>(); { tempCurrency.Setup(instance => instance.GetPrimaryStoreCurrency()).Returns(Task.FromResult(_currency)); //tempCurrency.Setup(instance => instance.ConvertToPrimaryStoreCurrency(It.IsAny<decimal>(), _currency)).ReturnsAsync(5); //_currencyService = tempCurrency.Object; } var cacheManager = new TestMemoryCacheManager(new Mock <IMemoryCache>().Object, _eventPublisher); IRepository <Currency> _currencyRepository; var tempCurrencyRepository = new Mock <IRepository <Currency> >(); { var IMongoCollection = new Mock <IMongoCollection <Currency> >().Object; IMongoCollection.InsertOne(_currency); tempCurrencyRepository.Setup(x => x.Table).Returns(IMongoCollection.AsQueryable()); tempCurrencyRepository.Setup(x => x.GetByIdAsync(_currency.Id)).ReturnsAsync(_currency); _currencyRepository = tempCurrencyRepository.Object; } IStoreMappingService _storeMappingService = new Mock <IStoreMappingService>().Object; var _serviceProvider = new Mock <IServiceProvider>().Object; _currencyService = new CurrencyService( cacheManager, _currencyRepository, _storeMappingService, _currencySettings, new PluginFinder(_serviceProvider), _eventPublisher); _priceCalcService = new PriceCalculationService( _workContext, _storeContext, _discountService, _categoryService, _manufacturerService, _productAttributeParser, _productService, _customerProductService, _vendorService, _currencyService, _shoppingCartSettings, _catalogSettings); }
public VendorController(IUserService UserService, IRoleService RoleService, IUserRoleService UserRoleService, IFormService FormService, IRoleDetailService RoleDetailService, ICompanyService CompanyService, ICustomerProductService CustomerProductService, ICityService CityService, ICountryService CountryService, IStateService StateService, ICustomerServices CustomerService, ICompanyLocationService CompanyLocationService, IMonthlySubscriptionService MonthlySubscriptionService, IVIPsetupService VIPsetupService) : base(UserService, RoleService, FormService, RoleDetailService, UserRoleService, VIPsetupService) { this._CompanyService = CompanyService; this._CityService = CityService; this._CountryService = CountryService; this._StateService = StateService; //this._ClientService = ClientService; this._UserRoleService = UserRoleService; this._CustomerService = CustomerService; this._UserService = UserService; this._CustomerProductService = CustomerProductService; this._CompanyLocationService = CompanyLocationService; this._MonthlySubscriptionService = MonthlySubscriptionService; }