public void TestGetNowWatching_CountNotNull() { var storeAction = new StoreAction(); var result = storeAction.PopularGoods(); // TODO: Add your test code here Assert.IsTrue(result?.Count() > 0); }
private static void Updating() { var store = new StoreAction(); var goods = store.GetAllGoods().Select(s => new GoodViewModel(s)).ToList(); sales = goods.Where(s => s.discount > 0).OrderByDescending(s => s.discount).Take(4); newes = goods.OrderByDescending(s => s.id).Take(4); foreach (var item in newes) { item.isNew = true; } var popularsFromAll = store.PopularGoods()?.Take(4).ToList(); populars = goods.Where(s => popularsFromAll?.Any(w => w.id == s.id) ?? false).ToList(); foreach (var item in populars) { item.isBestseller = true; } }