/// <summary>
        /// Initializes a new instance of the <see cref="ProductControllerTest"/> class.
        /// </summary>
        public ProductControllerTest()
        {
            _context = new Glass.Sitecore.Mapper.Context();
            GlassMapperService.Current = Substitute.For <Glass.Sitecore.Mapper.ISitecoreService>();

            this.productService      = Substitute.For <IProductService>();
            this.pricingService      = Substitute.For <IPricingService>();
            this.contentSearchHelper = Substitute.For <ContentSearchHelper>();
            this._inventoryService   = Substitute.For <IInventoryService>();
            this._catalogService     = Substitute.For <ICatalogService>();
            this._obecContext        = Substitute.For <CommerceContextBase>();

            var httpContext = Substitute.For <HttpContextBase>();

            httpContext.Request.Url.Returns(new Uri("http://host/path"));
            httpContext.Request.QueryString.Returns(new NameValueCollection());

            this.controller = new ProductController(this.productService, this.pricingService, this.contentSearchHelper, this._inventoryService, this._catalogService);
            this.controller.ControllerContext = new ControllerContext(httpContext, new RouteData(), this.controller);
        }
Ejemplo n.º 2
0
 private static void CreateContext(AttributeConfigurationLoader loader)
 {
     Assert.ArgumentNotNull(loader, "loader");
     var context = new Glass.Sitecore.Mapper.Context(loader, new GlassModuleLoader());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Configures the mapper.
 /// </summary>
 public static void ConfigMapper()
 {
     var loader  = new Glass.Sitecore.Mapper.Configuration.Attributes.AttributeConfigurationLoader("Sitecore.Commerce.StarterKit.Models, Sitecore.Commerce.StarterKit");
     var context = new Glass.Sitecore.Mapper.Context(loader);
 }
Ejemplo n.º 4
0
 private static void CreateContext(AttributeConfigurationLoader loader)
 {
     Assert.ArgumentNotNull(loader, "loader");
     var context = new Glass.Sitecore.Mapper.Context(loader, new GlassModuleLoader());
 }