Ejemplo n.º 1
0
        private AccessorFactory SetupMockAccessorFactory()
        {
            var factory = new AccessorFactory(mockData.Context, SetupMockUtilityFactory());

            // cart accessor mock
            var mockCartAccessor = new MockCartAccessor(mockData);

            factory.AddOverride <SalesAcc.ICartAccessor>(mockCartAccessor);

            // catalog accessor
            var mockCatalogAccessor = new MockCatalogAccessor(mockData);

            factory.AddOverride <CatAcc.ICatalogAccessor>(mockCatalogAccessor);

            // order accessor
            var mockOrderAccessor = new MockOrderAccessor(mockData);

            factory.AddOverride <SalesAcc.IOrderAccessor>(mockOrderAccessor);

            // payment accessor
            var mockPaymentAccessor = new MockPaymentAccessor(mockData);

            factory.AddOverride <SalesAcc.IPaymentAccessor>(mockPaymentAccessor);
            return(factory);
        }
Ejemplo n.º 2
0
        private AccessorFactory SetupMockAccessorFactory()
        {
            AccessorFactory accFactory = new AccessorFactory(this.mockData.Context, new UtilityFactory(new AmbientContext()));

            var mockCartAccessor = new MockCartAccessor(mockData);

            accFactory.AddOverride <ICartAccessor>(mockCartAccessor);

            var mockCatalogAccessor = new MockCatalogAccessor(mockData);

            accFactory.AddOverride <Accessors.Catalog.ICatalogAccessor>(mockCatalogAccessor);

            return(accFactory);
        }
        private AccessorFactory SetupMockAccessorFactory()
        {
            AccessorFactory accFactory = new AccessorFactory(mockData.Context, new UtilityFactory(new AmbientContext()));

            var mockOrderAccessor = new MockOrderAccessor(mockData);

            accFactory.AddOverride <acc.IOrderAccessor>(mockOrderAccessor);

            var mockRemittanceAccessor = new MockRemittanceAccessor(mockData);

            accFactory.AddOverride <accRemittance.IRemittanceAccessor>(mockRemittanceAccessor);

            return(accFactory);
        }
        private AccessorFactory SetupMockAccessorFactory()
        {
            AccessorFactory accFactory = new AccessorFactory(mockData.Context, new UtilityFactory(new AmbientContext()));

            // Order Accessor Mock
            var mockOrderAccessor = new MockOrderAccessor(mockData);

            accFactory.AddOverride <IOrderAccessor>(mockOrderAccessor);

            // Seller Accessor Mock
            var mockSellerAccessor = new MockSellerAccessor(mockData);

            accFactory.AddOverride <IOrderAccessor>(mockOrderAccessor);
            accFactory.AddOverride <ISellerAccessor>(mockSellerAccessor);

            return(accFactory);
        }
Ejemplo n.º 5
0
        public AccessorFactory SetupMockAccessorFactory()
        {
            var accFactory = new AccessorFactory(mockData.Context, SetupMockUtilityFactory());

            MockCatalogAccessor = new MockCatalogAccessor(mockData);
            accFactory.AddOverride <acc.ICatalogAccessor>(MockCatalogAccessor);
            return(accFactory);
        }
Ejemplo n.º 6
0
        private AccessorFactory SetupMockAccessorFactory()
        {
            // order accessor mock

            MockOrderAccessor mockOrderAccessor = new MockOrderAccessor(this.mockData);

            this.mockData.Orders.Clear();
            this.mockData.Orders.Add(
                _orderToFulfill);
            this.mockData.Orders.Add(new Order()
            {
                Id                = _badStatusOrderId,
                TaxAmount         = 0.11m,
                SubTotal          = 1.50m,
                Total             = 1.61m,
                Status            = OrderStatuses.Failed, // invalid status for fulfillment
                BillingAddress    = _validAddress,
                ShippingAddress   = _validAddress,
                AuthorizationCode = "auth code",
                OrderLines        = new OrderLine[]
                {
                    new OrderLine()
                    {
                        ProductId     = 1,
                        ProductName   = "Mock Product Name",
                        Quantity      = 1,
                        UnitPrice     = 1.50m,
                        ExtendedPrice = 1.50m
                    }
                }
            });

            // payment accessor mock
            MockPaymentAccessor mockPaymentAccessor = new MockPaymentAccessor(this.mockData);

            // shipping accessor mock
            MockShippingAccessor mockShippingAccessor = new MockShippingAccessor(this.mockData);

            AccessorFactory accFactory = new AccessorFactory(this.mockData.Context, new UtilityFactory(this.mockData.Context));

            accFactory.AddOverride <IOrderAccessor>(mockOrderAccessor);
            accFactory.AddOverride <IPaymentAccessor>(mockPaymentAccessor);
            accFactory.AddOverride <IShippingAccessor>(mockShippingAccessor);

            return(accFactory);
        }
Ejemplo n.º 7
0
        private AccessorFactory SetupMockAccessorFactory()
        {
            MockCatalogAccessor mockAccessor = new MockCatalogAccessor(this.mockData);

            mockData.Products.Clear();
            mockData.Products.Add(new Product()
            {
                Id    = 1,
                Price = 1.50m
            });
            mockData.Products.Add(new Product()
            {
                Id    = 2,
                Price = 2.00m
            });

            AccessorFactory accFactory = new AccessorFactory(mockData.Context, new UtilityFactory(new AmbientContext()));

            accFactory.AddOverride <catAcc.ICatalogAccessor>(mockAccessor);
            return(accFactory);
        }