public void SortedGivenShopListTest()
        {
            //Assign
            Supermarket sm;
            List<Category> categories;
            List<Product> products;
            SmartShopLogicsTests.CreateDataBaseObjects(out sm, out categories, out products);

            ShopList list = new ShopList();
            #region Populating shopping list
            list.Supermarket = sm;
            list.SuperMarketId = sm.Id;
            for (int i = 0; i < products.Count; i++)
            {
                Product currProduct = products[i];
                ShoplistItem newItem = new ShoplistItem() { Product = currProduct, Quantity = i, ShopList = list };
                list.ShoplistItems.Add(newItem);
            }
            #endregion

            //act
            DataBase dataBase = Substitute.For<DataBase>();
            SmartShopLogics bs = new SmartShopLogics(dataBase);
            ShopList sorted = bs.GetSortedList(list);

            //assert
            int lastCategoryId = -1;
            for (int i = 0; i < sorted.ShoplistItems.Count; i++)
            {
                List<ShoplistItem> items = sorted.ShoplistItems.ToList();
                int currCategory = items[i].Product.Category.CategorySorts.Where(cat => cat.Supermarket == sm).SingleOrDefault().SortValue;
                //If list is sorted, the sort value should always increase
                Assert.IsTrue(currCategory >= lastCategoryId, "Shopping list was not sorted properly ({0} sort value came before {1})",lastCategoryId, currCategory);
                lastCategoryId = currCategory;

            }
        }