public int CreateEvent(Event ev) { int ret = ValidateEvent(ev); if (ret != 0) { return(ret); } ticketRep.CreateEvent(ev); return(0); }
[TestCase(-1, 1)] //past public void EventTestTime2(int _day, int _areEqual) { Venue v1 = new Venue("", "A1", "", ""); ticketRep.CreateVenue(v1); Layout l1 = new Layout(v1.Id, "", "L1"); ticketRep.CreateLayout(l1); Area a1 = new Area(l1.Id, "A1", 0, 0); ticketRep.CreateArea(a1); Seat s1 = new Seat(a1.Id, 0, 0); ticketRep.CreateSeat(s1); Event e1 = new Event("", "", l1.Id, DateTime.Now.AddDays(3)); ticketRep.CreateEvent(e1); e1.StartDate = DateTime.Now.AddDays(_day); if (_areEqual == 0) { Assert.AreEqual(0, _business.UpdateEvent(e1)); } else { Assert.AreNotEqual(0, _business.UpdateEvent(e1)); } }