public void FixtureInit() { const string testFileName = @"DataFiles\Chevron June FG 462988.xlsx"; var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); if (directoryName == null) { return; } var projectPath = directoryName.Replace("file:\\", "").Replace("\\bin\\Debug", ""); _extractor = new OrderLineExtractor(); //_extractor.SourcePath = Path.Combine(projectPath, testFileName); _shipService = A.Fake <IShippingCostService>(); _templatePathService = new HardCodedTemplatePathService(); A.CallTo(() => _shipService.BoxFee).Returns(2.50m); A.CallTo(() => _shipService.PickPackFee).Returns(0.50m); _invoiceService = new InvoiceService(_extractor, _shipService, _templatePathService); _invoiceService.SourcePath = Path.Combine(projectPath, testFileName); _freightPurchaseOrders = _invoiceService.GetFreightPurchaseOrders("462988"); _productPurchaseOrders = _invoiceService.GetProductPurchaseOrders("462988"); }
/// <summary> /// Instantiates a new instance of CheckoutController with the provided arguments /// </summary> /// <param name="veilDataAccess"> /// The <see cref="IVeilDataAccess"/> to use for database access /// </param> /// <param name="idGetter"> /// The <see cref="IGuidUserIdGetter"/> to use for getting the current user's Id /// </param> /// <param name="stripeService"> /// The <see cref="IStripeService"/> to use for Stripe interaction /// </param> /// <param name="shippingCostService"> /// The <see cref="IShippingCostService"/> to use for getting the shipping cost for /// the items in the cart /// </param> /// <param name="userManager"> /// The <see cref="VeilUserManager"/> to use for sending an order confirmation email /// </param> public CheckoutController(IVeilDataAccess veilDataAccess, IGuidUserIdGetter idGetter, IStripeService stripeService, IShippingCostService shippingCostService, VeilUserManager userManager) { db = veilDataAccess; this.idGetter = idGetter; this.stripeService = stripeService; this.shippingCostService = shippingCostService; this.userManager = userManager; }
public InvoiceService( IExtractor <FlexCelOrderLineDto> extractor, IShippingCostService shippingCostService, ITemplatePathService templatePathService ) { _extractor = extractor; _shippingCostService = shippingCostService; _templatePathService = templatePathService; }
public void FixtureInit() { var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); if (directoryName == null) { return; } _projectPath = directoryName.Replace("file:\\", "").Replace("bin\\Debug", "DataFiles"); _extractor = new OrderLineExtractor(); _shipService = A.Fake <IShippingCostService>(); _templateService = A.Fake <ITemplatePathService>(); _invoiceService = new InvoiceService(_extractor, _shipService, _templateService); _invoiceService.SourcePath = Path.Combine(_projectPath, TestFileName); A.CallTo(() => _shipService.PickPackFee).Returns(0.50m); A.CallTo(() => _shipService.BoxFee).Returns(2.50m); }
public ProductStateGroup(IShippingCostService shipCostService) { _shipCostService = shipCostService; }
public ShippingCostController(IShippingCostService shippingCostService) { this.shippingCostService = shippingCostService; }
protected CheckoutController CreateCheckoutController( IVeilDataAccess veilDataAccess = null, IGuidUserIdGetter idGetter = null, IStripeService stripeService = null, IShippingCostService shippingCostService = null, VeilUserManager userManager = null, ControllerContext context = null) { idGetter = idGetter ?? TestHelpers.GetSetupIUserIdGetterFake(memberId).Object; context = context ?? TestHelpers.GetSetupControllerContextFakeWithUserIdentitySetup().Object; var controller = new CheckoutController( veilDataAccess, idGetter, stripeService, shippingCostService, userManager) { ControllerContext = context }; return controller; }