public void LoadAppointentByIdTest()
        {
            var service = ExchangeHelper.GetService(ExchangePass, ExchangeServerUrl, ExchangeLogin);

            DateTime.TryParse("10-Jun-2019", out var start);
            var meeting = AppointmentHelper.GetAppointmentBySubject(service, "Item1", start);

            AppointmentHelper.GetAppointmentById(service, meeting.Id.ToString());

            Assert.AreEqual(1, 1);
        }
        public void LoadAppointentBySubjTest()
        {
            var service = ExchangeHelper.GetService(ExchangePass, ExchangeServerUrl, ExchangeLogin);

            var subj = "Item1";

            DateTime.TryParse("10-Jun-2019", out var start);
            AppointmentHelper.GetAppointmentBySubject(service, subj, start);

            Assert.AreEqual(1, 1);
        }
        public void LoadResponseByIdTest()
        {
            var service = ExchangeHelper.GetService(ExchangePass, ExchangeServerUrl, ExchangeLogin);

            var subj = "Item1";

            DateTime.TryParse("10-Jun-2019", out var start);
            var meeting = AppointmentHelper.GetAppointmentBySubject(service, subj, start);

            AppointmentHelper.GetAttendeesById(service, meeting.Id.ToString(), MeetingAttendeeType.Required);

            Assert.AreEqual(1, 1);
        }
        public void LoadAppointmentsTest()
        {
            var service = ExchangeHelper.GetService(ExchangePass, ExchangeServerUrl, ExchangeLogin);

            DateTime.TryParse("10-Jun-2019", out var start);
            var meeting = AppointmentHelper.GetAppointmentBySubject(service, "Item1", start);

            var appointments = AppointmentHelper.GetAppointmentsById(service, meeting.Id.ToString());

            foreach (var item in appointments)
            {
                Console.WriteLine(item.AppointmentType.ToString());
            }
        }
        /// <inheritdoc />
        protected override void Execute(CodeActivityContext context)
        {
            var service = ExchangeHelper.GetService(context.GetValue(OrganizerPassword), context.GetValue(ExchangeUrl), context.GetValue(OrganizerEmail));

            Appointment meeting;

            var id = context.GetValue(AppointmentId);

            if (string.IsNullOrEmpty(id))
            {
                var start = DateTime.Parse(context.GetValue(AppointmentDate));
                meeting = AppointmentHelper.GetAppointmentBySubject(service, context.GetValue(Subject), start);
            }
            else
            {
                meeting = AppointmentHelper.GetAppointmentById(service, id);
            }

            context.SetValue(FoundAppointment, meeting);
        }
        public void AttachedAppointmentTest()
        {
            DateTime.TryParse("06-July-2019", out var testStartDate);

            var service     = ExchangeHelper.GetService(ExchangePass, ExchangeServerUrl, ExchangeLogin);
            var appointment = AppointmentHelper.GetAppointmentBySubject(service, "AppointmentAttachmentCheck1", testStartDate);

            if (appointment != null)
            {
                var toRemind = AppointmentHelper.GetAttendeesById(service, appointment.Id.ToString(), MeetingAttendeeType.Required)
                               .Where(x => x.ResponseType == MeetingResponseType.Unknown || x.ResponseType == MeetingResponseType.NoResponseReceived)
                               .Select(attendee => (EmailAddress)attendee.Address)
                               .ToList();

                // remind if any
                if (toRemind.Count > 0)
                {
                    appointment.Forward("Please resond to an attached invitation", toRemind);
                }
            }

            Assert.AreNotEqual(1, 2);
        }