Пример #1
0
        public void SearchItems_RequestAllItems_ShouldPass()
        {
            using var context = new MarketDbContext(inMemoryConnection);
            Store[] stores = DataForTests.CreateStoresForSearchTests(storeHandler, context);

            Dictionary <Guid, ReadOnlyCollection <Item> > results =
                searchFacade.SearchItems(context: context,
                                         filterItemRank: null,
                                         filterMinPrice: null,
                                         filterMaxPrice: null,
                                         filterStoreRank: null);

            Assert.AreEqual(4, results.Keys.Count);

            ReadOnlyCollection <Item> resultStore  = results[stores[0].Id];
            ReadOnlyCollection <Item> resultStore1 = results[stores[1].Id];
            ReadOnlyCollection <Item> resultStore2 = results[stores[2].Id];
            ReadOnlyCollection <Item> resultStore3 = results[stores[3].Id];

            Assert.AreEqual(3, resultStore.Count);
            Assert.AreEqual(4, resultStore1.Count);
            Assert.AreEqual(5, resultStore2.Count);
            Assert.AreEqual(1, resultStore3.Count);
        }