Ejemplo n.º 1
0
        public void GetObjectIdTest()
        {
            var objectId            = new ObjectId();
            var periodicAppointment = new PeriodicAppointmentBuilder().SetObjectId(objectId).Build();

            new DiaryProductTest().GetObjectIdTest(periodicAppointment, objectId);
        }
Ejemplo n.º 2
0
        public void ConstructorNotToExceedDateTimeAliasingTest()
        {
            var occurs = new DateTime(new Date(1, Date.Month.JANUARY, 2000), 0, 0);
            var notToExceedDateTime = new Diary.DateTime(occurs);

            var occurenceDate = new Date(2, Date.Month.JANUARY, 2000);

            var builder = new PeriodicAppointmentBuilder();

            builder.SetOccurs(occurs);
            builder.SetPeriodHours(24);
            builder.SetNotToExceedDateTime(notToExceedDateTime);
            var appointment = (PeriodicAppointment)builder.Build();

            var expected = false;
            var actual   = appointment.IsOccuringOn(occurenceDate);

            Assert.AreEqual(expected, actual, "Original");

            notToExceedDateTime.AddTime(100, 0);

            actual = appointment.IsOccuringOn(occurenceDate);

            Assert.AreEqual(expected, actual, "After");
        }
Ejemplo n.º 3
0
        public void InvalidDurationForEndDateTest()
        {
            var severalDaysWorthOfMinutes = 1440 * 3;

            var builder = new PeriodicAppointmentBuilder();

            builder.SetOccurs(new Diary.DateTime());
            builder.SetDurationMinutes(severalDaysWorthOfMinutes);
            builder.SetNotToExceedDateTime(new Diary.DateTime());
            var appointment = (PeriodicAppointment)builder.Build();
        }
Ejemplo n.º 4
0
        public void PeriodicAppointmentConstructorTest()
        {
            var builder = new PeriodicAppointmentBuilder();

            builder.SetLabel("Test Label");
            builder.SetDetails("Detail text");

            builder.SetOccurs(new DateTime(new Date(1, Date.Month.JANUARY, 2003), 0, 0));
            builder.SetNotToExceedDateTime(new DateTime(new Date(2, Date.Month.JANUARY, 2003), 0, 0));
            builder.SetDurationMinutes(42);

            Helper.AssertAreEqual(builder, (PeriodicAppointment)builder.Build(), "");
        }
Ejemplo n.º 5
0
        public void GetContactsTest()
        {
            var builder = new PeriodicAppointmentBuilder();

            var appointment = (PeriodicAppointment)builder.SetContactBuilders().Build();

            var contactBuilders = builder.GetContactBuilders();

            foreach (var contactBuilder in contactBuilders)
            {
                appointment.AddRelation((Contact)contactBuilder.Build());
            }

            Helper.AssertAreEqual(builder, appointment, "");
        }