Beispiel #1
0
        public RecommendedProductSortingServiceTests()
        {
            var configurationMock    = new Mock <IConfiguration>();
            var shopperApiClientMock = new Mock <IShopperHistoryApiClient>();

            configurationMock
            .SetupGet(m => m[It.IsAny <string>()])
            .Returns("token");

            shopperApiClientMock
            .Setup(m => m.GetShopperHistoryAsync(It.IsAny <string>()))
            .ReturnsAsync(new List <Customer>
            {
                new Customer
                {
                    Products = new List <Product>
                    {
                        new Product {
                            Name = "A", Quantity = 1, Price = 10
                        },
                        new Product {
                            Name = "B", Quantity = 2, Price = 10
                        },
                        new Product {
                            Name = "C", Quantity = 3, Price = 10
                        },
                    }
                },
                new Customer
                {
                    Products = new List <Product>
                    {
                        new Product {
                            Name = "A", Quantity = 2, Price = 10
                        },
                        new Product {
                            Name = "C", Quantity = 1, Price = 10
                        },
                    }
                }
            });

            _productSortingOption = new RecommendedProductSortingService(configurationMock.Object, shopperApiClientMock.Object);
        }
Beispiel #2
0
 public LowPriceProductSortingServiceTests()
 {
     _productSortingOption = new LowPriceProductSortingService();
 }
 public AscendingNameProductSortingServiceTests()
 {
     _productSortingOption = new AscendingNameProductSortingService();
 }
 public HighPriceProductSortingServiceTests()
 {
     _productSortingOption = new HighPriceProductSortingService();
 }