Inheritance: IntervalRecurrencePatternBaseType
        public void MSOXWSMTGS_S01_TC20_CreateItemErrorCalendarInvalidDayForWeeklyRecurrence()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(12052, this.Site), "Exchange 2007, Exchange 2010 and Exchange 2013 do not support ErrorCalendarInvalidDayForWeeklyRecurrence.");

            #region Define a calendar item
            int timeInterval = this.TimeInterval;
            DateTime startTime = DateTime.Now.AddHours(timeInterval);

            WeeklyRecurrencePatternType pattern = new WeeklyRecurrencePatternType();
            pattern.DaysOfWeek = "Random";
            IntervalRecurrencePatternBaseType patternIntervalRecurrence = pattern as IntervalRecurrencePatternBaseType;
            patternIntervalRecurrence.Interval = this.PatternInterval;
            RecurrenceType recurrence = new RecurrenceType();
            recurrence.Item = patternIntervalRecurrence;
            EndDateRecurrenceRangeType endDateRange = new EndDateRecurrenceRangeType();
            DateTime startDate = startTime.AddMonths(1);
            endDateRange.StartDate = new DateTime(startDate.Year, startDate.Month, startDate.Day, 0, 0, 0, DateTimeKind.Utc);
            endDateRange.EndDate = endDateRange.StartDate.AddMonths(8);
            recurrence.Item1 = endDateRange;

            CalendarItemType calendarItem = new CalendarItemType();
            calendarItem.UID = Guid.NewGuid().ToString();
            calendarItem.Subject = this.Subject;
            calendarItem.Start = startTime;
            calendarItem.StartSpecified = true;
            timeInterval++;
            calendarItem.End = startTime.AddHours(timeInterval);
            calendarItem.EndSpecified = true;
            calendarItem.Location = this.Location;
            calendarItem.Recurrence = new RecurrenceType();
            calendarItem.Recurrence = recurrence;
            calendarItem.RequiredAttendees = new AttendeeType[] { GetAttendeeOrResource(this.AttendeeEmailAddress) };
            calendarItem.OptionalAttendees = new AttendeeType[] { GetAttendeeOrResource(this.OrganizerEmailAddress) };
            #endregion

            #region Create the recurring calendar item and extract the Id of an occurrence item
            CreateItemType createItemRequest = new CreateItemType();
            createItemRequest.Items = new NonEmptyArrayOfAllItemsType();
            createItemRequest.Items.Items = new ItemType[] { calendarItem };
            createItemRequest.MessageDispositionSpecified = true;
            createItemRequest.MessageDisposition = MessageDispositionType.SaveOnly;
            createItemRequest.SendMeetingInvitationsSpecified = true;
            createItemRequest.SendMeetingInvitations = CalendarItemCreateOrDeleteOperationType.SendToNone;
            CreateItemResponseType response = this.MTGSAdapter.CreateItem(createItemRequest);

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R12052");

            // Verify MS-OXWSMSG requirement: MS-OXWSMTGS_R12052
            Site.CaptureRequirementIfAreEqual<ResponseCodeType>(
                ResponseCodeType.ErrorCalendarInvalidDayForWeeklyRecurrence,
                response.ResponseMessages.Items[0].ResponseCode,
                12052,
                @"[In Appendix C: Product Behavior] Implementation does support the ErrorCalendarInvalidDayForWeeklyRecurrence to specify that invalid values of Day, WeekDay, and WeekendDay were used to specify the weekly recurrence. (Exchange 2016 and above follow this behavior.)");
            #endregion

            #region Clean up organizer's calendar folders.
            this.CleanupFoldersByRole(Role.Organizer, new List<DistinguishedFolderIdNameType>() { DistinguishedFolderIdNameType.calendar });
            #endregion
        }
 public void MSOXWSMTGS_S01_TC11_ModifyOccurrenceWithWeeklyPatternAndEndDateRange()
 {
     // Verify WeeklyRecurrencePatternType and EndDateRecurrenceRangeType.
     WeeklyRecurrencePatternType weeklyPattern = new WeeklyRecurrencePatternType();
     weeklyPattern.DaysOfWeek = "Tuesday";
     EndDateRecurrenceRangeType endDateRange = new EndDateRecurrenceRangeType();
     this.VerifyModifiedOccurrences(weeklyPattern, endDateRange);
 }