public void AddPurchaseEvent() { PurchaseEvent e = GetEvent(); int initialCount = eventRepository.GetAllPurchaseEvents().Count; eventRepository.AddPurchaseEvent(e); int actualCount = eventRepository.GetAllPurchaseEvents().Count; PurchaseEvent addedEvent = eventRepository.GetPurchaseEventById(e.Id); Assert.AreEqual(addedEvent.Id, e.Id); Assert.AreEqual(addedEvent.ClientId, e.ClientId); Assert.AreEqual(addedEvent.ProductId, e.ProductId); Assert.AreEqual(initialCount, actualCount - 1); }
public PurchaseEvent GetPurchaseById(int id) { return(purchaseRepository.GetPurchaseEventById(id)); }