예제 #1
0
        public void MSASAIRS_S06_TC01_MeetingResponseWithPlainTextBody()
        {
            Site.Assume.AreNotEqual <string>("12.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The Body element under meetingresponse:SendResponse element is supported when the MS-ASProtocolVersion header is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");
            Site.Assume.AreNotEqual <string>("14.0", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The Body element under meetingresponse:SendResponse element is supported when the MS-ASProtocolVersion header is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");
            Site.Assume.AreNotEqual <string>("14.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The Body element under meetingresponse:SendResponse element is supported when the MS-ASProtocolVersion header is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");

            #region Call Sync command with Add element to add a no recurrence meeting to the server.
            string subject       = Common.GenerateResourceName(Site, "Subject");
            string attendeeEmail = Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain);

            Dictionary <Request.ItemsChoiceType8, object> elementsToValueMap = TestSuiteHelper.SetMeetingProperties(subject, attendeeEmail, this.Site);
            DateTime startTime = DateTime.Now.AddMinutes(-5);
            DateTime endTime   = startTime.AddHours(1);
            elementsToValueMap.Add(Request.ItemsChoiceType8.StartTime, startTime.ToString("yyyyMMddTHHmmssZ"));
            elementsToValueMap.Add(Request.ItemsChoiceType8.EndTime, endTime.ToString("yyyyMMddTHHmmssZ"));

            this.SyncAddMeeting(this.User1Information.CalendarCollectionId, elementsToValueMap);

            this.RecordCaseRelativeItems(this.User1Information.UserName, this.User1Information.CalendarCollectionId, subject);
            #endregion

            #region Call Sync command to get the added calendar item.
            SyncStore getChangeResult = this.GetSyncResult(subject, this.User1Information.CalendarCollectionId, null);
            Microsoft.Protocols.TestSuites.Common.DataStructures.Sync resultItem = TestSuiteHelper.GetSyncAddItem(getChangeResult, subject);
            #endregion

            #region Call SendMail command to send the meeting request to attendee without setting BusyStatus.
            Calendar calendarItem = resultItem.Calendar;
            calendarItem.BusyStatus = null;
            this.SendMeetingRequest(subject, calendarItem);
            #endregion

            #region Call Sync command to get the meeting request and accept it.
            this.SwitchUser(this.User2Information, true);

            // Sync mailbox changes
            SyncStore syncChangeResult = this.GetSyncResult(subject, this.User2Information.InboxCollectionId, null);
            Microsoft.Protocols.TestSuites.Common.DataStructures.Sync meetingRequestEmail = TestSuiteHelper.GetSyncAddItem(syncChangeResult, subject);

            Request.MeetingResponseRequestSendResponse sendResoponse = new Request.MeetingResponseRequestSendResponse()
            {
                Body = new Request.Body()
                {
                    Type = 1,
                    Data = "Accept this meeting."
                }
            };

            // Accept the meeting request
            // Create a meeting response request item
            Request.MeetingResponseRequest meetingResponseRequestItem = new Request.MeetingResponseRequest
            {
                UserResponse = 1,
                CollectionId = this.User2Information.InboxCollectionId,
                RequestId    = meetingRequestEmail.ServerId,
                SendResponse = sendResoponse,
            };

            // Create a meeting response request
            MeetingResponseRequest  meetingRequest = Common.CreateMeetingResponseRequest(new Request.MeetingResponseRequest[] { meetingResponseRequestItem });
            MeetingResponseResponse response       = this.ASAIRSAdapter.MeetingResponse(meetingRequest);

            this.Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(response.ResponseData.Result[0].Status),
                1331,
                @"[In Body] When the Body element is a child of the meetingresponse:SendResponse element [or the composemail:SmartForward element], it has only the child elements Type and Data.");

            this.Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(response.ResponseData.Result[0].Status),
                1333,
                @"[In Body] The Body element is a child of the meetingresponse:SendResponse element and the composemail:SmartForward element only when protocol version 16.0 is used.");

            // Because the Type element is 1 and client call the MeetingResponse command successful.
            // So R1400 will be verified.
            this.Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(response.ResponseData.Result[0].Status),
                1400,
                @"[In Type (Body)] For calendar items in protocol version 16.0, the only valid values for this element [Type] is 1 (plain text).");
            #endregion

            #region Call Sync command to get the calendar item.
            SyncStore getCalendarItemsResult = this.GetSyncResult(subject, this.User2Information.CalendarCollectionId, null);
            Microsoft.Protocols.TestSuites.Common.DataStructures.Sync calendarResult = TestSuiteHelper.GetSyncAddItem(getCalendarItemsResult, subject);
            Site.Assert.IsNotNull(calendarResult.Calendar.BusyStatus, "Element BusyStatus should be present.");
            #endregion
        }
        public void MSASAIRS_S06_TC01_MeetingResponseWithPlainTextBody()
        {
            Site.Assume.AreNotEqual<string>("12.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The Body element under meetingresponse:SendResponse element is supported when the MS-ASProtocolVersion header is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");
            Site.Assume.AreNotEqual<string>("14.0", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The Body element under meetingresponse:SendResponse element is supported when the MS-ASProtocolVersion header is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");
            Site.Assume.AreNotEqual<string>("14.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The Body element under meetingresponse:SendResponse element is supported when the MS-ASProtocolVersion header is set to 16.0. MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion.");

            #region Call Sync command with Add element to add a no recurrence meeting to the server.
            string subject = Common.GenerateResourceName(Site, "Subject");
            string attendeeEmail = Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain);

            Dictionary<Request.ItemsChoiceType8, object> elementsToValueMap = TestSuiteHelper.SetMeetingProperties(subject, attendeeEmail, this.Site);
            DateTime startTime = DateTime.Now.AddMinutes(-5);
            DateTime endTime = startTime.AddHours(1);
            elementsToValueMap.Add(Request.ItemsChoiceType8.StartTime, startTime.ToString("yyyyMMddTHHmmssZ"));
            elementsToValueMap.Add(Request.ItemsChoiceType8.EndTime, endTime.ToString("yyyyMMddTHHmmssZ"));

            this.SyncAddMeeting(this.User1Information.CalendarCollectionId, elementsToValueMap);

            this.RecordCaseRelativeItems(this.User1Information.UserName, this.User1Information.CalendarCollectionId, subject);
            #endregion

            #region Call Sync command to get the added calendar item.
            SyncStore getChangeResult = this.GetSyncResult(subject, this.User1Information.CalendarCollectionId, null);
            Microsoft.Protocols.TestSuites.Common.DataStructures.Sync resultItem = TestSuiteHelper.GetSyncAddItem(getChangeResult, subject);
            #endregion

            #region Call SendMail command to send the meeting request to attendee without setting BusyStatus.
            Calendar calendarItem = resultItem.Calendar;
            calendarItem.BusyStatus = null;
            this.SendMeetingRequest(subject, calendarItem);
            #endregion

            #region Call Sync command to get the meeting request and accept it.
            this.SwitchUser(this.User2Information, true);

            // Sync mailbox changes
            SyncStore syncChangeResult = this.GetSyncResult(subject, this.User2Information.InboxCollectionId, null);
            Microsoft.Protocols.TestSuites.Common.DataStructures.Sync meetingRequestEmail = TestSuiteHelper.GetSyncAddItem(syncChangeResult, subject);

            Request.MeetingResponseRequestSendResponse sendResoponse=new Request.MeetingResponseRequestSendResponse()
            {
                Body=new Request.Body()
                {
                    Type= 1,
                    Data="Accept this meeting."
                }
            };

            // Accept the meeting request
            // Create a meeting response request item
            Request.MeetingResponseRequest meetingResponseRequestItem = new Request.MeetingResponseRequest
            {
                UserResponse = 1,
                CollectionId = this.User2Information.InboxCollectionId,
                RequestId = meetingRequestEmail.ServerId,
                SendResponse = sendResoponse,
            };

            // Create a meeting response request
            MeetingResponseRequest meetingRequest = Common.CreateMeetingResponseRequest(new Request.MeetingResponseRequest[] { meetingResponseRequestItem });
            MeetingResponseResponse response = this.ASAIRSAdapter.MeetingResponse(meetingRequest);

            this.Site.CaptureRequirementIfAreEqual<int>(
                1,
                int.Parse(response.ResponseData.Result[0].Status),
                1331,
                @"[In Body] When the Body element is a child of the meetingresponse:SendResponse element [or the composemail:SmartForward element], it has only the child elements Type and Data.");

            this.Site.CaptureRequirementIfAreEqual<int>(
                1,
                int.Parse(response.ResponseData.Result[0].Status),
                1333,
                @"[In Body] The Body element is a child of the meetingresponse:SendResponse element and the composemail:SmartForward element only when protocol version 16.0 is used.");

            // Because the Type element is 1 and client call the MeetingResponse command successful.
            // So R1400 will be verified.
            this.Site.CaptureRequirementIfAreEqual<int>(
                1,
                int.Parse(response.ResponseData.Result[0].Status),
                1400,
                @"[In Type (Body)] For calendar items in protocol version 16.0, the only valid values for this element [Type] is 1 (plain text).");
            #endregion

            #region Call Sync command to get the calendar item.
            SyncStore getCalendarItemsResult = this.GetSyncResult(subject, this.User2Information.CalendarCollectionId, null);
            Microsoft.Protocols.TestSuites.Common.DataStructures.Sync calendarResult = TestSuiteHelper.GetSyncAddItem(getCalendarItemsResult, subject);
            Site.Assert.IsNotNull(calendarResult.Calendar.BusyStatus, "Element BusyStatus should be present.");
            #endregion
        }