本文整理汇总了C#中IAddressService.Expect方法的典型用法代码示例。如果您正苦于以下问题:C# IAddressService.Expect方法的具体用法?C# IAddressService.Expect怎么用?C# IAddressService.Expect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAddressService
的用法示例。
在下文中一共展示了IAddressService.Expect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public new void SetUp()
{
_taxSettings = new TaxSettings();
_taxSettings.DefaultTaxAddressId = 10;
_workContext = null;
_addressService = MockRepository.GenerateMock<IAddressService>();
//default tax address
_addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId });
var pluginFinder = new PluginFinder();
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
_geoLookupService = MockRepository.GenerateMock<IGeoLookupService>();
_countryService = MockRepository.GenerateMock<ICountryService>();
_logger = MockRepository.GenerateMock<ILogger>();
_customerSettings = new CustomerSettings();
_addressSettings = new AddressSettings();
_taxService = new TaxService(_addressService, _workContext, _taxSettings,
pluginFinder, _geoLookupService, _countryService, _logger
, _customerSettings, _addressSettings);
}
示例2: SetUp
public new void SetUp()
{
_taxSettings = new TaxSettings();
_taxSettings.DefaultTaxAddressId = 10;
_workContext = null;
_cartSettings = new ShoppingCartSettings();
_addressService = MockRepository.GenerateMock<IAddressService>();
//default tax address
_addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
var pluginFinder = new PluginFinder();
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
_settingService = MockRepository.GenerateMock<ISettingService>();
_geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _cartSettings, pluginFinder, _settingService, _geoCountryLookup, this.ProviderManager);
}
示例3: SetUp
public new void SetUp()
{
_workContext = MockRepository.GenerateMock<IWorkContext>();
_store = new Store() { Id = 1 };
_storeContext = MockRepository.GenerateMock<IStoreContext>();
_storeContext.Expect(x => x.CurrentStore).Return(_store);
var pluginFinder = new PluginFinder();
var cacheManager = new NopNullCache();
//price calculation service
_discountService = MockRepository.GenerateMock<IDiscountService>();
_categoryService = MockRepository.GenerateMock<ICategoryService>();
_productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
_shoppingCartSettings = new ShoppingCartSettings();
_catalogSettings = new CatalogSettings();
_priceCalcService = new PriceCalculationService(_workContext, _discountService,
_categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
_localizationService = MockRepository.GenerateMock<ILocalizationService>();
//shipping
_shippingSettings = new ShippingSettings();
_shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
_shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
_shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
_logger = new NullLogger();
_shippingService = new ShippingService(cacheManager,
_shippingMethodRepository,
_logger,
_productAttributeParser,
_checkoutAttributeParser,
_genericAttributeService,
_localizationService,
_shippingSettings, pluginFinder,
_eventPublisher, _shoppingCartSettings);
_paymentService = MockRepository.GenerateMock<IPaymentService>();
_checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
_giftCardService = MockRepository.GenerateMock<IGiftCardService>();
_genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
//tax
_taxSettings = new TaxSettings();
_taxSettings.ShippingIsTaxable = true;
_taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
_taxSettings.DefaultTaxAddressId = 10;
_addressService = MockRepository.GenerateMock<IAddressService>();
_addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
_taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);
_rewardPointsSettings = new RewardPointsSettings();
_orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
_priceCalcService, _taxService, _shippingService, _paymentService,
_checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService,
_taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);
}
示例4: SetUp
public new void SetUp()
{
_workContext = null;
_store = new Store() { Id = 1 };
_storeContext = MockRepository.GenerateMock<IStoreContext>();
_storeContext.Expect(x => x.CurrentStore).Return(_store);
var pluginFinder = new PluginFinder();
_shoppingCartSettings = new ShoppingCartSettings();
_catalogSettings = new CatalogSettings();
var cacheManager = new NopNullCache();
_productService = MockRepository.GenerateMock<IProductService>();
//price calculation service
_discountService = MockRepository.GenerateMock<IDiscountService>();
_categoryService = MockRepository.GenerateMock<ICategoryService>();
_productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
_priceCalcService = new PriceCalculationService(_workContext, _storeContext,
_discountService, _categoryService,
_productAttributeParser, _productService,
cacheManager, _shoppingCartSettings, _catalogSettings);
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
_localizationService = MockRepository.GenerateMock<ILocalizationService>();
//shipping
_shippingSettings = new ShippingSettings();
_shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
_shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
_shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
_deliveryDateRepository = MockRepository.GenerateMock<IRepository<DeliveryDate>>();
_warehouseRepository = MockRepository.GenerateMock<IRepository<Warehouse>>();
_logger = new NullLogger();
_shippingService = new ShippingService(_shippingMethodRepository,
_deliveryDateRepository,
_warehouseRepository,
_logger,
_productService,
_productAttributeParser,
_checkoutAttributeParser,
_genericAttributeService,
_localizationService,
_addressService,
_shippingSettings,
pluginFinder,
_storeContext,
_eventPublisher,
_shoppingCartSettings,
cacheManager);
_shipmentService = MockRepository.GenerateMock<IShipmentService>();
_paymentService = MockRepository.GenerateMock<IPaymentService>();
_checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
_giftCardService = MockRepository.GenerateMock<IGiftCardService>();
_genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
//tax
_taxSettings = new TaxSettings();
_taxSettings.ShippingIsTaxable = true;
_taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
_taxSettings.DefaultTaxAddressId = 10;
_addressService = MockRepository.GenerateMock<IAddressService>();
_addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
_taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);
_rewardPointsSettings = new RewardPointsSettings();
_orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
_priceCalcService, _taxService, _shippingService, _paymentService,
_checkoutAttributeParser, _discountService, _giftCardService,
_genericAttributeService,
_taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);
_orderService = MockRepository.GenerateMock<IOrderService>();
_webHelper = MockRepository.GenerateMock<IWebHelper>();
_languageService = MockRepository.GenerateMock<ILanguageService>();
_priceFormatter= MockRepository.GenerateMock<IPriceFormatter>();
_productAttributeFormatter= MockRepository.GenerateMock<IProductAttributeFormatter>();
_shoppingCartService= MockRepository.GenerateMock<IShoppingCartService>();
_checkoutAttributeFormatter= MockRepository.GenerateMock<ICheckoutAttributeFormatter>();
_customerService= MockRepository.GenerateMock<ICustomerService>();
_encryptionService = MockRepository.GenerateMock<IEncryptionService>();
_workflowMessageService = MockRepository.GenerateMock<IWorkflowMessageService>();
_customerActivityService = MockRepository.GenerateMock<ICustomerActivityService>();
_currencyService = MockRepository.GenerateMock<ICurrencyService>();
_affiliateService = MockRepository.GenerateMock<IAffiliateService>();
_vendorService = MockRepository.GenerateMock<IVendorService>();
_pdfService = MockRepository.GenerateMock<IPdfService>();
_paymentSettings = new PaymentSettings()
{
ActivePaymentMethodSystemNames = new List<string>()
{
"Payments.TestMethod"
//.........这里部分代码省略.........
示例5: SetUp
public new void SetUp()
{
_workContext = MockRepository.GenerateMock<IWorkContext>();
_store = new Store { Id = 1 };
_storeContext = MockRepository.GenerateMock<IStoreContext>();
_storeContext.Expect(x => x.CurrentStore).Return(_store);
var pluginFinder = new PluginFinder();
_shoppingCartSettings = new ShoppingCartSettings();
_catalogSettings = new CatalogSettings();
//price calculation service
_discountService = MockRepository.GenerateMock<IDiscountService>();
_categoryService = MockRepository.GenerateMock<ICategoryService>();
_productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
_productService = MockRepository.GenerateMock<IProductService>();
_productAttributeService = MockRepository.GenerateMock<IProductAttributeService>();
_genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
_settingService = MockRepository.GenerateMock<ISettingService>();
_typeFinder = MockRepository.GenerateMock<ITypeFinder>();
//shipping
_shippingSettings = new ShippingSettings();
_shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
_shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
_shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
_logger = new NullLogger();
_shippingService = new ShippingService(
_shippingMethodRepository,
_logger,
_productAttributeParser,
_productService,
_checkoutAttributeParser,
_genericAttributeService,
_shippingSettings,
_eventPublisher,
_shoppingCartSettings,
_settingService,
this.ProviderManager,
_typeFinder);
_providerManager = MockRepository.GenerateMock<IProviderManager>();
_checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
_giftCardService = MockRepository.GenerateMock<IGiftCardService>();
//tax
_taxSettings = new TaxSettings();
_taxSettings.ShippingIsTaxable = true;
_taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
_taxSettings.PricesIncludeTax = false;
_taxSettings.TaxDisplayType = TaxDisplayType.IncludingTax;
_taxSettings.DefaultTaxAddressId = 10;
_addressService = MockRepository.GenerateMock<IAddressService>();
_addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId });
_downloadService = MockRepository.GenerateMock<IDownloadService>();
_services = MockRepository.GenerateMock<ICommonServices>();
_httpRequestBase = MockRepository.GenerateMock<HttpRequestBase>();
_geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);
_rewardPointsSettings = new RewardPointsSettings();
_priceCalcService = new PriceCalculationService(_discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings,
_productAttributeService, _downloadService, _services, _httpRequestBase, _taxService);
_orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
_priceCalcService, _taxService, _shippingService, _providerManager,
_checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, _productAttributeParser,
_taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);
}
示例6: SetUp
public new void SetUp()
{
_taxSettings = new TaxSettings();
_taxSettings.DefaultTaxAddressId = 10;
_workContext = null;
_addressService = MockRepository.GenerateMock<IAddressService>();
//default tax address
_addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
var pluginFinder = new PluginFinder(new AppDomainTypeFinder());
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
_taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);
}