Microsoft.Protocols.TestSuites.MS_ASCMD.S09_MeetingResponse.MSASCMD_S09_TC15_MeetingResponse_AcceptMeetingInCalendarFolder C# (CSharp) Method

MSASCMD_S09_TC15_MeetingResponse_AcceptMeetingInCalendarFolder() private method

        public void MSASCMD_S09_TC15_MeetingResponse_AcceptMeetingInCalendarFolder()
        {
            Site.Assume.AreNotEqual<SutVersion>(SutVersion.ExchangeServer2007, Common.GetSutVersion(this.Site), "Exchange 2007 SP3 does not use MeetingResponse command on Calendar folder.");

            #region User1 calls SendMail command to send one meeting request to user2
            string meetingRequestSubject = Common.GenerateResourceName(Site, "subject");
            string attendeeEmailAddress = Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain);
            Calendar calendar = this.CreateCalendar(meetingRequestSubject, attendeeEmailAddress, null);

            // Send a meeting request email to user2
            this.SendMeetingRequest(meetingRequestSubject, calendar);
            #endregion

            #region Get new added meeting request email
            // Switch to user2 mailbox
            this.SwitchUser(this.User2Information);

            // Sync Inbox folder
            SyncResponse syncResponse = this.GetMailItem(this.User2Information.InboxCollectionId, meetingRequestSubject);
            string serverIDForMeetingRequest = TestSuiteBase.FindServerId(syncResponse, "Subject", meetingRequestSubject);

            // Sync Calendar folder
            SyncResponse syncCalendarBeforeMeetingResponse = this.GetMailItem(this.User2Information.CalendarCollectionId, meetingRequestSubject);
            string calendarItemServerID = TestSuiteBase.FindServerId(syncCalendarBeforeMeetingResponse, "Subject", meetingRequestSubject);
            #endregion

            #region Call method MeetingResponse to accept the meeting request in the user2's Calendar folder.
            MeetingResponseRequest meetingResponseRequest = TestSuiteBase.CreateMeetingResponseRequest(1, this.User2Information.InboxCollectionId, serverIDForMeetingRequest, string.Empty);

            // If the user accepts the meeting request, the meeting request mail will be deleted and calendar item will be created.
            MeetingResponseResponse meetingResponseResponse = this.CMDAdapter.MeetingResponse(meetingResponseRequest);

            bool isVerifiedR5707 = meetingResponseResponse.ResponseData.Result[0].CalendarId != null && meetingResponseResponse.ResponseData.Result[0].Status != "0";

            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR5707,
                5707,
                @"[In MeetingResponse] The MeetingResponse command is used to accept [, tentatively accept, or decline] a meeting request in the [user's Inbox folder or] Calendar folder.<3>");
            #endregion
        }