public ProductDetailsPresenter(IProductDetailsView view, IProductRepository productRepository, IEntityViewModelMapper entityViewModelMapper) { _view = view; _productRepository = productRepository; _entityViewModelMapper = entityViewModelMapper; }
/// <summary> /// Initializes a new instance of the <see cref="ProductDetailsPresenterTest" /> class. /// </summary> public ProductDetailsPresenterTest() { this.view = Substitute.For<IProductDetailsView>(); this.product = new Product { Code = "d3" }; this.productRepository = Substitute.For<IProductRepository>(); this.productRepository.Get<Product>("d3").Returns(this.product); this.priceManager = Substitute.For<IProductPriceManager>(); this.priceManager.GetProductTotals<Totals, Product, Currency>(this.product, null).Returns(new Totals { PriceExVat = 7.00m }); this.stockManager = Substitute.For<IProductStockManager>(); this.stockManager.GetStock(Arg.Is<ProductStockInfo>(p => p.ProductCode == "d3")).Returns(new Products.ProductStock { Code = "d3", Stock = 5 }); this.orderManager = Substitute.For<VisitorOrderManager>(); this.httpContext = Substitute.For<HttpContextBase>(); new ProductDetailsPresenter(this.view, this.productRepository, this.stockManager, this.priceManager, this.orderManager) { HttpContext = this.httpContext }; }
public ProductDetailsPresenter(IProductDetailsView view) { this.view = view; this.logger = SharePointServiceLocator.Current.GetInstance <ILogger>(); }
public static ProductDetailsPresenter ProductDetailsPresenter(IProductDetailsView view) { return new ProductDetailsPresenter(view, ProductRepository, EntityViewModelMapper); }