Beispiel #1
0
        public async Task OnlySameCategory()
        {
            var product = await TestSubject.GetAsync(1);

            var results = (await TestSubject.GetSuggestionsAsync(product, Products.SellMode.Downsell)).ToList();

            Assert.IsTrue(results.All(_ => _.Category == product.Category));
        }
Beispiel #2
0
        public async Task ExcludeSameProduct()
        {
            var product = await TestSubject.GetAsync(3);

            var results = (await TestSubject.GetSuggestionsAsync(product, Products.SellMode.Downsell)).ToList();

            Assert.IsTrue(results.All(_ => _.ProductID != product.ProductID));
        }
Beispiel #3
0
        public async Task DownsellsReturnLowerPricedProducts()
        {
            var product = await TestSubject.GetAsync(1);

            var results = (await TestSubject.GetSuggestionsAsync(product, Products.SellMode.Downsell)).ToList();

            Assert.IsTrue(results.All(_ => _.Price <= product.Price));
        }
Beispiel #4
0
        public async Task OnlyReturnAvailable()
        {
            var product = await TestSubject.GetAsync(1);

            var results = (await TestSubject.GetSuggestionsAsync(product, Products.SellMode.Downsell)).ToList();

            Assert.IsTrue(results.All(_ => _.Available));
        }
Beispiel #5
0
        public async Task SuggestionsOnlyReturnLimitedResults()
        {
            var product = await TestSubject.GetAsync(1);

            var results = (await TestSubject.GetSuggestionsAsync(product, Products.SellMode.Downsell)).ToList();

            Assert.AreEqual(3, results.Count);
        }