public void AllocateSeatTest() { var cus = new Customer { Name = "Ashish", SeatRequest = 5 }; cus.AllocateSeat(3, 1); Assert.AreEqual(3, cus.AllocatedRow); Assert.AreEqual(1, cus.AllocatedSection); }
public void AllocateThisSection(Customer[] name, int requiredSeats) { if (EmpltySeats >= requiredSeats) { OccupiedSeats += requiredSeats; GivenTo.AddRange(name); this.GivenTo.All(x => x.IsSeatAllocated = true); } else { throw new Exception("Section cannot be allocated, not enough seats"); } }
public void AllocateThisSectionTest() { var model = new Section { TotalnumberofSeats = 6, OccupiedSeats = 1, GivenTo = new List<Customer>() }; var cus = new Customer { Name = "Ashish", SeatRequest = 5 }; model.AllocateThisSection(new Customer[] {cus}, 5); Assert.AreEqual(0, model.EmpltySeats); Assert.AreEqual(6, model.OccupiedSeats); }