public int CreateArea(Area ar) { int ret = ValidateArea(ar); if (ret != 0) { return(ret); } ticketRep.CreateArea(ar); return(0); }
[TestCase(1, 1)] // don't have seats public void EventTestSeats(int layoutNum, int _areEqual) { Venue v1 = new Venue("", "A1", "", ""); ticketRep.CreateVenue(v1); Layout[] layout = new Layout[] { new Layout(v1.Id, "L1_d", "L1"), new Layout(v1.Id, "L2_d", "L2") }; ticketRep.CreateLayout(layout[0]); ticketRep.CreateLayout(layout[1]); Area a1 = new Area(layout[0].Id, "A1", 0, 0); Area a2 = new Area(layout[1].Id, "A2", 0, 0); ticketRep.CreateArea(a1); ticketRep.CreateArea(a2); Seat s1 = new Seat(a1.Id, 0, 0); ticketRep.CreateSeat(s1); Event e1 = new Event("", "", layout[layoutNum].Id, DateTime.Now.AddDays(3)); if (_areEqual == 0) { Assert.AreEqual(0, _business.CreateEvent(e1)); } else { Assert.AreNotEqual(0, _business.CreateEvent(e1)); } }