public void Collect(DateTime requestDate) { var allMarkets = MarketRepository.GetMarkets(true); var allPrices = GetAllPrices(allMarkets, requestDate).ToList(); var newPrices = GetNewPrices(allPrices).ToList(); PriceRepository.Save(newPrices); }
public void UpdateWithExistingPriceReturnsTrue() { IRepository <Product> priceRepository = new PriceRepository(); priceRepository.Save(product); bool updated = priceRepository.Update(updatedProduct); Assert.IsTrue(updated); }
public void GetByProductNameWithNonExistentProductNameReturnsNull() { IRepository <Product> priceRepository = new PriceRepository(); priceRepository.Save(product); var price = priceRepository.GetByProductName("Bananas"); Assert.IsNull(price); }
public void SaveAddsPriceToList() { IRepository <Product> priceRepository = new PriceRepository(); priceRepository.Save(product); var priceList = priceRepository.GetAll(); Assert.AreEqual(priceList.Count, 1); }
public void GetByProductNameWithExistingProductNameReturnsRightPrice() { IRepository <Product> priceRepository = new PriceRepository(); priceRepository.Save(product); var price = priceRepository.GetByProductName("Can of soup"); Assert.AreEqual(price.ProductName, "Can of soup"); Assert.AreEqual(price.Price, 2.5f); }
public void SaveAddsRightDataToList() { IRepository <Product> priceRepository = new PriceRepository(); priceRepository.Save(product); var priceList = priceRepository.GetAll(); Assert.AreEqual(priceList[0].ProductName, "Can of soup"); Assert.AreEqual(priceList[0].Price, 2.5f); }
public void UpdateWithExistingPriceUpdatesRightData() { IRepository <Product> priceRepository = new PriceRepository(); priceRepository.Save(product); bool updated = priceRepository.Update(updatedProduct); var priceList = priceRepository.GetAll(); Assert.IsTrue(updated); Assert.AreEqual(priceList[0].ProductName, "Can of soup"); Assert.AreEqual(priceList[0].Price, 2.8f); }