Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public List <PurchaseEvent> GetAllPurchases()
 {
     return(purchaseRepository.GetAllPurchaseEvents());
 }