Exemplo n.º 1
0
        /// <summary>
        /// Call MeetingResponse command to respond the meeting request
        /// </summary>
        /// <param name="userResponse">The value indicates whether the meeting is being accepted, tentatively accepted, or declined</param>
        /// <param name="collectionId">Specify the server id of mailbox</param>
        /// <param name="serverId">Specify a unique identifier that was assigned by the server for a mailItem</param>
        /// <param name="instanceId">Specify the start time of the appointment or meeting instance to be modified. The format of the instanceId value
        /// is a string in dateTime ([MS-ASDTYPE] section 2.3) format with the punctuation separators, for example, 2010-04-08T18:16:00.000Z</param>
        /// <returns>a bool value</returns>
        protected bool MeetingResponse(byte userResponse, string collectionId, string serverId, string instanceId)
        {
            bool isSuccess = false;

            // Create a MeetingResponse request item
            Request.MeetingResponseRequest meetingResponseRequestItem = new Request.MeetingResponseRequest
            {
                UserResponse = userResponse,
                CollectionId = collectionId,
                RequestId    = serverId
            };

            if (!string.IsNullOrEmpty(instanceId))
            {
                meetingResponseRequestItem.InstanceId = instanceId;
            }

            // Create a MeetingResponse request
            MeetingResponseRequest  meetingResponseRequest  = Common.CreateMeetingResponseRequest(new Request.MeetingResponseRequest[] { meetingResponseRequestItem });
            MeetingResponseResponse meetingResponseResponse = this.CALAdapter.MeetingResponse(meetingResponseRequest);

            if (meetingResponseResponse.ResponseData.Result[0].Status == "1")
            {
                isSuccess = true;
            }

            return(isSuccess);
        }
        /// <summary>
        /// Create a MeetingResponse request.
        /// </summary>
        /// <param name="userResponse">The way the user response the meeting.</param>
        /// <param name="collectionID">The collection id of the folder that contains the meeting request.</param>
        /// <param name="requestIDList">The server ID list of the meeting request message item.</param>
        /// <param name="instanceID">The instance ID of the recurring meeting to be modified.</param>
        /// <returns>The MeetingResponse request.</returns>
        private static MeetingResponseRequest CreateMultiMeetingResponseRequest(byte userResponse, string collectionID, List<string> requestIDList, string instanceID)
        {
            List<Request.MeetingResponseRequest> requestList = new List<Request.MeetingResponseRequest>();
            foreach (string requestID in requestIDList)
            {
                Request.MeetingResponseRequest request = new Request.MeetingResponseRequest
                {
                    CollectionId = collectionID,
                    RequestId = requestID,
                    UserResponse = userResponse
                };

                // Set the instanceId of the meeting request to response
                if (!string.IsNullOrEmpty(instanceID))
                {
                    request.InstanceId = instanceID;
                }

                requestList.Add(request);
            }

            return Common.CreateMeetingResponseRequest(requestList.ToArray());
        }
Exemplo n.º 3
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
        }
Exemplo n.º 5
0
        /// <summary>
        /// Call MeetingResponse command to accept a meeting.
        /// </summary>
        /// <param name="collectionId">The CollectionId of the folder in which the meeting request is placed.</param>
        /// <param name="itemServerId">The ServerId of the meeting request.</param>
        protected void CallMeetingResponseCommand(string collectionId, string itemServerId)
        {
            // Create MeetingResponse request.
            Request.MeetingResponseRequest[] meetingResponseRequest = new Request.MeetingResponseRequest[1];
            meetingResponseRequest[0] = new Request.MeetingResponseRequest
            {
                CollectionId = collectionId,
                RequestId = itemServerId,
                UserResponse = 1
            };
            MeetingResponseRequest request = Common.CreateMeetingResponseRequest(meetingResponseRequest);

            // Call MeetingResponse command by HTTP POST.
            SendStringResponse meetingResponseResponse = this.HTTPAdapter.HTTPPOST(CommandName.MeetingResponse, null, request.GetRequestDataSerializedXML());

            // Check the command is executed successfully.
            this.CheckResponseStatus(meetingResponseResponse.ResponseDataXML);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Call MeetingResponse command to respond the meeting request
        /// </summary>
        /// <param name="userResponse">The value indicates whether the meeting is being accepted, tentatively accepted, or declined</param>
        /// <param name="collectionId">Specify the server id of mailbox</param>
        /// <param name="serverId">Specify a unique identifier that was assigned by the server for a mailItem</param>
        /// <param name="instanceId">Specify the start time of the appointment or meeting instance to be modified. The format of the instanceId value
        /// is a string in dateTime ([MS-ASDTYPE] section 2.3) format with the punctuation separators, for example, 2010-04-08T18:16:00.000Z</param>
        /// <returns>a bool value</returns>
        protected bool MeetingResponse(byte userResponse, string collectionId, string serverId, string instanceId)
        {
            bool isSuccess = false;

            // Create a MeetingResponse request item
            Request.MeetingResponseRequest meetingResponseRequestItem = new Request.MeetingResponseRequest
            {
                UserResponse = userResponse,
                CollectionId = collectionId,
                RequestId = serverId
            };

            if (!string.IsNullOrEmpty(instanceId))
            {
                meetingResponseRequestItem.InstanceId = instanceId;
            }

            // Create a MeetingResponse request
            MeetingResponseRequest meetingResponseRequest = Common.CreateMeetingResponseRequest(new Request.MeetingResponseRequest[] { meetingResponseRequestItem });
            MeetingResponseResponse meetingResponseResponse = this.CALAdapter.MeetingResponse(meetingResponseRequest);

            if (meetingResponseResponse.ResponseData.Result[0].Status == "1")
            {
                isSuccess = true;
            }

            return isSuccess;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Create a MeetingResponse request.
        /// </summary>
        /// <param name="userResponse">The way the user response the meeting.</param>
        /// <param name="collectionID">The collection id of the folder that contains the meeting request.</param>
        /// <param name="requestID">The server ID of the meeting request message item.</param>
        /// <param name="instanceID">The instance ID of the recurring meeting to be modified.</param>
        /// <returns>The MeetingResponse request.</returns>
        protected static MeetingResponseRequest CreateMeetingResponseRequest(byte userResponse, string collectionID, string requestID, string instanceID)
        {
            Request.MeetingResponseRequest request = new Request.MeetingResponseRequest
            {
                CollectionId = collectionID,
                RequestId = requestID,
                UserResponse = userResponse
            };

            if (!string.IsNullOrEmpty(instanceID))
            {
                request.InstanceId = instanceID;
            }

            return Common.CreateMeetingResponseRequest(new Request.MeetingResponseRequest[] { request });
        }