public List<Waitlist> GetWaitList() { var errors = new List<string>(); var repository = new WaitlistRepository(); var service = new WaitlistService(repository); return service.GetWaitlist(ref errors); }
public void InsertWaitlistErrorTest() { //// Arrange var errors = new List<string>(); var mockRepository = new Mock<IWaitlistRepository>(); var waitlistservice = new WaitlistService(mockRepository.Object); //// Act waitlistservice.InsertWaitlist(null, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public void InsertWaitlistErrorTest2() { //// Arranage var errors = new List<string>(); var mockRepository = new Mock<IWaitlistRepository>(); var waitlistservice = new WaitlistService(mockRepository.Object); var waitlist = new Waitlist { StudentId = string.Empty }; //// Act waitlistservice.InsertWaitlist(waitlist, ref errors); //// Assert Assert.AreEqual(1, errors.Count); }
public string InsertWaitlist(Waitlist waitlist) { var errors = new List<string>(); var repository = new WaitlistRepository(); var service = new WaitlistService(repository); service.InsertWaitlist(null, ref errors); if (errors.Count == 0) { return "ok"; } return "error"; }
public string UpdateStudent(Waitlist waitlist) { var errors = new List<string>(); var repository = new WaitlistRepository(); var service = new WaitlistService(repository); service.UpdateWaitlist(waitlist, ref errors); if (errors.Count == 0) { return "ok"; } return "error"; }