/// <summary>
        /// Verify the AttendeeType structure.
        /// </summary>
        /// <param name="attendee">Attendee or resource for a meeting</param>
        /// <param name="isSchemaValidated">The result of schema validation, true means valid.</param>
        private void VerifyAttendeeType(AttendeeType attendee, bool isSchemaValidated)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R368");

            // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R368
            Site.CaptureRequirementIfIsTrue(
             isSchemaValidated,
             368,
             @"[In t:NonEmptyArrayOfAttendeesType Complex Type] The type of Attendee type is t:AttendeeType (section 2.2.4.2).");

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

            // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R135
            Site.CaptureRequirementIfIsTrue(
                isSchemaValidated,
                135,
                @"[In t:AttendeeType Complex Type] [its schema is]  <xs:complexType name=""AttendeeType"">
                   <xs:sequence>
                     <xs:element name=""Mailbox""
                       type=""t:EmailAddressType""
                      />
                     <xs:element name=""ResponseType""
                       type=""t:ResponseTypeType""
                       minOccurs=""0""
                      />
                     <xs:element name=""LastResponseTime""
                       type=""xs:dateTime""
                       minOccurs=""0""                
                      />
                     <xs:element name=""ProposedStart""
                       type=""xs:dateTime"" 
                       minOccurs=""0""
                      />
                     <xs:element name=""ProposedEnd"" 
                       type=""xs:dateTime"" 
                       minOccurs=""0""
                      />
                   </xs:sequence>
                 </xs:complexType>");

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

            // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R136
            Site.CaptureRequirementIfIsTrue(
                isSchemaValidated,
                136,
                @"[In t:AttendeeType Complex Type] The type of Mailbox is t:EmailAddressType ([MS-OXWSCDATA] section 2.2.4.27).");

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

            this.Site.CaptureRequirementIfIsTrue(
                isSchemaValidated,
                138,
                @"[In t:AttendeeType Complex Type] The type of  ResponseType is t:ResponseTypeType (section 2.2.5.10).");

            if (attendee.LastResponseTimeSpecified)
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R140");

                this.Site.CaptureRequirementIfIsTrue(
                    isSchemaValidated,
                    140,
                    @"[In t:AttendeeType Complex Type] The type of LastResponseTime is xs:dateTime ([XMLSCHEMA2]).");
            }

            if (attendee.ProposedStartSpecified)
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R1042");

                this.Site.CaptureRequirementIfIsTrue(
                    isSchemaValidated,
                    1042,
                    @"[In t:AttendeeType Complex Type] The type of ProposedStart is xs:dateTime.");
            }

            if (attendee.ProposedEndSpecified)
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R1044");

                this.Site.CaptureRequirementIfIsTrue(
                    isSchemaValidated,
                    1044,
                    @"[In t:AttendeeType Complex Type] The type of ProposedEnd is xs:dateTime.");
            }

            // Verify child element EmailAddressType.
            this.VerifyEmailAddressType(attendee.Mailbox, isSchemaValidated);

            if (attendee.ResponseTypeSpecified == true)
            {
                this.VerifyResponseTypeType(isSchemaValidated);
            }
        }
        public void MSOXWSCORE_S05_TC21_ResponseObjectsProposeNewTime()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(2302, this.Site), "Exchange 2007, Exchange 2010, and the initial release of Exchange 2013 do not support the ProposeNewTime element. ");

            #region Organizer sends meeting to attendee.
            CalendarItemType item = new CalendarItemType();
            item.RequiredAttendees = new AttendeeType[1];
            EmailAddressType attendeeEmail = new EmailAddressType();
            attendeeEmail.EmailAddress = Common.GetConfigurationPropertyValue("User2Name", this.Site) + "@" + Common.GetConfigurationPropertyValue("Domain", this.Site);
            AttendeeType attendee = new AttendeeType();
            attendee.Mailbox = attendeeEmail;
            item.RequiredAttendees[0] = attendee;

            CreateItemType createItemRequest = new CreateItemType();
            createItemRequest.Items = new NonEmptyArrayOfAllItemsType();
            createItemRequest.Items.Items = new ItemType[] { item };
            createItemRequest.Items.Items[0].Subject = Common.GenerateResourceName(this.Site, TestSuiteHelper.SubjectForCreateItem);
            createItemRequest.SendMeetingInvitations = CalendarItemCreateOrDeleteOperationType.SendOnlyToAll;
            createItemRequest.SendMeetingInvitationsSpecified = true;

            CreateItemResponseType createItemResponse = this.COREAdapter.CreateItem(createItemRequest);

            // Check the operation response.
            Common.CheckOperationSuccess(createItemResponse, 1, this.Site);

            ItemIdType[] createdItemIds = Common.GetItemIdsFromInfoResponse(createItemResponse);

            // One created item should be returned.
            Site.Assert.AreEqual<int>(
                1,
                 createdItemIds.GetLength(0),
                 "One created item should be returned! Expected Item Count: {0}, Actual Item Count: {1}",
                 1,
                 createdItemIds.GetLength(0));
            #endregion

            #region Attendee gets the meeting request
            ItemIdType[] findItemIds = this.FindItemsInFolder(DistinguishedFolderIdNameType.inbox, createItemRequest.Items.Items[0].Subject, "User2");
            Site.Assert.AreEqual<int>(1, findItemIds.Length, "Attendee should receive the meeting request");

            GetItemResponseType getItemResponse = this.CallGetItemOperation(findItemIds);

            // Check the operation response.
            Common.CheckOperationSuccess(getItemResponse, 1, this.Site);

            // Check whether the child elements of ResponseObjects have been returned successfully.
            ItemInfoResponseMessageType getItems = getItemResponse.ResponseMessages.Items[0] as ItemInfoResponseMessageType;
            ResponseObjectType[] responseObjects = getItems.Items.Items[0].ResponseObjects;
            foreach (ResponseObjectType responseObject in responseObjects)
            {
                if (responseObject.GetType() == typeof(ProposeNewTimeType))
                {
                    // Add the debug information
                    this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2302");

                    // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2302
                    // Element ProposeNewTime is returned from server, this requirement can be captured directly.
                    this.Site.CaptureRequirement(
                        2302,
                        @"[In Appendix C: Product Behavior] Implementation does support the ProposeNewTime element which specifies the response object that is used to propose a new time. (<82> Section 2.2.4.33:  This element [ProposeNewTime] was introduced in Exchange 2013 SP1.)");

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

                    // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2135
                    // Element ProposeNewTime is returned from server and pass schema validation, this requirement can be captured directly.
                    this.Site.CaptureRequirement(
                        2135,
                        @"[In t:NonEmptyArrayOfResponseObjectsType Complex Type] The type of ProposeNewTime is t:ProposeNewTimeType ([MS-OXWSCDATA] section 2.2.4.38).");
                    break;
                }
            }

            this.CleanItemsSentOut(new string[] { createItemRequest.Items.Items[0].Subject });
            this.ExistItemIds.Remove(getItems.Items.Items[0].ItemId);
            #endregion
        }
        /// <summary>
        /// Verify the NonEmptyArrayOfAttendeesType structure
        /// </summary>
        /// <param name="arrayOfAttendee">Contains a list representing attendees and resources for a meeting</param>
        /// <param name="isSchemaValidated">The result of schema validation, true means valid.</param>
        private void VeirfyNonEmptyArrayOfAttendeesType(AttendeeType[] arrayOfAttendee, bool isSchemaValidated)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R367");

            // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R367
            Site.CaptureRequirementIfIsTrue(
             isSchemaValidated,
             367,
             @"[In t:NonEmptyArrayOfAttendeesType Complex Type] [its schema is] <xs:complexType name=""NonEmptyArrayOfAttendeesType"">
                  <xs:sequence>
                    <xs:element name=""Attendee""
                      type=""t:AttendeeType""
                      maxOccurs=""unbounded""
                     />
                  </xs:sequence>
                </xs:complexType>");

            foreach (AttendeeType attendeeType in arrayOfAttendee)
            {
                this.VerifyAttendeeType(attendeeType, isSchemaValidated);
            }
        }