public void IsReminderDate_ReminderDateIsFutureDateBeforeTourDate_ValidReminder() { DT.Tour tour = new DT.Tour(); tour.TourDate = new DateTime(2015, 1, 1); tour.ReminderDate = new DateTime(2014, 12, 31); Assert.IsTrue(tour.IsReminderDateValid()); }
public void IsReminderDate_ReminderDateIsCurrentTime_InvalidReminder() { DT.Tour tour = new DT.Tour(); tour.TourDate = new DateTime(2015, 1, 1); tour.ReminderDate = DateTime.Now; Assert.IsFalse(tour.IsReminderDateValid()); }
public void IsReminderTypeValid_TourDateIsCurrentTime_ReminderNotApplicable() { DT.Tour tour = new DT.Tour(); tour.TourDate = DateTime.Now; tour.ReminderTypes = new List <ReminderType>() { ReminderType.Email }; Assert.IsFalse(tour.IsReminderTypeValid()); }
public void IsReminderDateValid_ReminderDateIsPastTime_InvalidReminder() { DT.Tour tour = new DT.Tour(); tour.TourDate = new DateTime(2015, 1, 1); tour.ReminderTypes = new List <ReminderType>() { ReminderType.Email }; tour.ReminderDate = new DateTime(2014, 1, 1); Assert.IsFalse(tour.IsReminderDateValid()); }
public DT.Tour CreateTourWithCustomValues(int tourId, int contactsCount, short tourType, short communityId, DateTime tourDate, ReminderType reminderType, DateTime?reminderDate) { DT.Tour tour = new DT.Tour(); tour.Id = tourId; tour.Contacts = new List <Contacts.Contact>(); for (int i = 0; i < contactsCount; i++) { Person person = new Person(); person.Id = i; person.FirstName = "FN" + i; person.LastName = "LN"; tour.Contacts.Add(person); } tour.CommunityID = communityId; tour.TourDate = tourDate; tour.ReminderTypes = new List <ReminderType>() { reminderType }; tour.ReminderDate = reminderDate; return(tour); }
public void IsContactsCountValid_ContactsNull_AtleastOneContactRequiredException() { DT.Tour tour = new DT.Tour(); tour.Contacts = null; Assert.IsFalse(tour.IsContactsCountValid()); }
public void IsContactsCountValid_ContactsCountMoreThanZero_ValidContacts() { DT.Tour tour = new DT.Tour(); tour.Contacts = tourdata.CreateContactsList(2); Assert.IsTrue(tour.IsContactsCountValid()); }
public void IsCommunityValid_CommunityIdGreaterThanZero_ValidCommunity() { DT.Tour tour = new DT.Tour(); tour.CommunityID = 1; Assert.IsTrue(tour.IsCommunityValid()); }
public void IsCommunityValid_CommunityIDEqualsZero_InvalidCommunityException() { DT.Tour tour = new DT.Tour(); tour.CommunityID = 0; Assert.IsFalse(tour.IsCommunityValid()); }
public void IsTourDetailsValid_DetailsLengthGreaterThan1000_InvalidTourDetailsException() { DT.Tour tour = new DT.Tour(); tour.TourDetails = new string('a', 1001); Assert.IsFalse(tour.IsTourDetailsValid()); }
public void IsTourDetailsValid_DetailsIsEmpty_ValidTourDetails() { DT.Tour tour = new DT.Tour(); tour.TourDetails = null; Assert.IsTrue(tour.IsTourDetailsValid()); }
public void IsTourDetailsValid_DetailsLengthIs1000_ValidTourDetails() { DT.Tour tour = new DT.Tour(); tour.TourDetails = new string('a', 1000); Assert.IsTrue(tour.IsTourDetailsValid()); }
public void IsTourTypeValid_TourTypeIsZero_ValidContacts() { DT.Tour tour = new DT.Tour(); tour.TourType = 0; Assert.IsFalse(tour.IsTourTypeValid()); }
public void IsTourTypeValid_TourTypeIsNotZero_ValidTourType() { DT.Tour tour = new DT.Tour(); tour.TourType = 3; Assert.IsTrue(tour.IsTourTypeValid()); }
public void IsContactsCountValid_ContactsCountZero_AtleastOneContactRequiredException() { DT.Tour tour = new DT.Tour(); tour.Contacts = tourdata.CreateContactsList(0); Assert.IsFalse(tour.IsContactsCountValid()); }