コード例 #1
0
 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());
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 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());
 }
コード例 #4
0
 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());
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 public void IsContactsCountValid_ContactsNull_AtleastOneContactRequiredException()
 {
     DT.Tour tour = new DT.Tour();
     tour.Contacts = null;
     Assert.IsFalse(tour.IsContactsCountValid());
 }
コード例 #7
0
 public void IsContactsCountValid_ContactsCountMoreThanZero_ValidContacts()
 {
     DT.Tour tour = new DT.Tour();
     tour.Contacts = tourdata.CreateContactsList(2);
     Assert.IsTrue(tour.IsContactsCountValid());
 }
コード例 #8
0
 public void IsCommunityValid_CommunityIdGreaterThanZero_ValidCommunity()
 {
     DT.Tour tour = new DT.Tour();
     tour.CommunityID = 1;
     Assert.IsTrue(tour.IsCommunityValid());
 }
コード例 #9
0
 public void IsCommunityValid_CommunityIDEqualsZero_InvalidCommunityException()
 {
     DT.Tour tour = new DT.Tour();
     tour.CommunityID = 0;
     Assert.IsFalse(tour.IsCommunityValid());
 }
コード例 #10
0
 public void IsTourDetailsValid_DetailsLengthGreaterThan1000_InvalidTourDetailsException()
 {
     DT.Tour tour = new DT.Tour();
     tour.TourDetails = new string('a', 1001);
     Assert.IsFalse(tour.IsTourDetailsValid());
 }
コード例 #11
0
 public void IsTourDetailsValid_DetailsIsEmpty_ValidTourDetails()
 {
     DT.Tour tour = new DT.Tour();
     tour.TourDetails = null;
     Assert.IsTrue(tour.IsTourDetailsValid());
 }
コード例 #12
0
 public void IsTourDetailsValid_DetailsLengthIs1000_ValidTourDetails()
 {
     DT.Tour tour = new DT.Tour();
     tour.TourDetails = new string('a', 1000);
     Assert.IsTrue(tour.IsTourDetailsValid());
 }
コード例 #13
0
 public void IsTourTypeValid_TourTypeIsZero_ValidContacts()
 {
     DT.Tour tour = new DT.Tour();
     tour.TourType = 0;
     Assert.IsFalse(tour.IsTourTypeValid());
 }
コード例 #14
0
 public void IsTourTypeValid_TourTypeIsNotZero_ValidTourType()
 {
     DT.Tour tour = new DT.Tour();
     tour.TourType = 3;
     Assert.IsTrue(tour.IsTourTypeValid());
 }
コード例 #15
0
 public void IsContactsCountValid_ContactsCountZero_AtleastOneContactRequiredException()
 {
     DT.Tour tour = new DT.Tour();
     tour.Contacts = tourdata.CreateContactsList(0);
     Assert.IsFalse(tour.IsContactsCountValid());
 }