예제 #1
0
        /// <summary>
        /// MeetingResponse for accepting or declining a meeting request
        /// </summary>
        /// <param name="meetingResponseRequest">The request for MeetingResponse</param>
        /// <returns>The MeetingResponse response which is returned from server</returns>
        public MeetingResponseResponse MeetingResponse(MeetingResponseRequest meetingResponseRequest)
        {
            MeetingResponseResponse response = this.activeSyncClient.MeetingResponse(meetingResponseRequest);

            Site.Assert.IsNotNull(response, "If the operation is successful, the response should not be null.");
            return(response);
        }
        /// <summary>
        /// Accept, tentatively accept, or decline a meeting request in the user's Inbox folder or Calendar folder
        /// </summary>
        /// <param name="request">A MeetingResponseRequest object that contains the request information.</param>
        /// <returns>A MeetingResponseResponse object.</returns>
        public MeetingResponseResponse MeetingResponse(MeetingResponseRequest request)
        {
            MeetingResponseResponse response = this.activeSyncClient.MeetingResponse(request);

            Site.Assert.IsNotNull(response, "If the MeetingResponse command executes successfully, the response from server should not be null.");
            return(response);
        }
예제 #3
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>
        /// Accepts, tentatively accepts, or declines a meeting request in the user's Inbox folder or Calendar folder.
        /// </summary>
        /// <param name="request">A MeetingResponseRequest object that contains the request information.</param>
        /// <returns>MeetingResponse command response</returns>
        public MeetingResponseResponse MeetingResponse(MeetingResponseRequest request)
        {
            MeetingResponseResponse response = this.activeSyncClient.MeetingResponse(request);

            this.VerifyTransportRequirements();
            this.VerifyWBXMLCapture(CommandName.MeetingResponse, response);
            this.VerifyMeetingResponseCommand(response);
            return(response);
        }
예제 #5
0
        public void MSASCMD_S17_TC05_SmartForwardWithInstanceIdSuccess()
        {
            Site.Assume.AreNotEqual <string>("16.0", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "Recurrences cannot be added in protocol version 16.0");

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

            #region User2 calls Sync command to sync user2 mailbox changes
            this.SwitchUser(this.User2Information);
            SyncResponse syncMeetingMailResponse = this.GetMailItem(this.User2Information.InboxCollectionId, meetingRequestSubject);

            // Record relative items for clean up.
            TestSuiteBase.RecordCaseRelativeItems(this.User2Information, this.User2Information.InboxCollectionId, meetingRequestSubject);
            #endregion

            #region User2 calls MeetingResponse command to accept the meeting
            string serverIDForMeetingRequest = TestSuiteBase.FindServerId(syncMeetingMailResponse, "Subject", meetingRequestSubject);
            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);
            Site.Assert.IsNotNull(meetingResponseResponse.ResponseData.Result[0].CalendarId, "If the meeting was accepted, server should return calendarId in response");
            TestSuiteBase.RemoveRecordCaseRelativeItems(this.User2Information, this.User2Information.InboxCollectionId, meetingRequestSubject);
            this.GetMailItem(this.User2Information.DeletedItemsCollectionId, meetingRequestSubject);
            TestSuiteBase.RecordCaseRelativeItems(this.User2Information, this.User2Information.DeletedItemsCollectionId, meetingRequestSubject);
            #endregion

            #region User2 calls Sync command to sync user calendar changes
            SyncResponse        syncCalendarResponse = this.GetMailItem(this.User2Information.CalendarCollectionId, meetingRequestSubject);
            string              calendarItemID       = TestSuiteBase.FindServerId(syncCalendarResponse, "Subject", meetingRequestSubject);
            string              startTime            = (string)TestSuiteBase.GetElementValueFromSyncResponse(syncCalendarResponse, calendarItemID, Response.ItemsChoiceType8.StartTime);
            Response.Recurrence recurrence           = (Response.Recurrence)TestSuiteBase.GetElementValueFromSyncResponse(syncCalendarResponse, calendarItemID, Response.ItemsChoiceType8.Recurrence);
            Site.Assert.IsNotNull(recurrence, "If user2 received recurring meeting request, the calendar item should contain recurrence element");

            // Record relative items for clean up.
            TestSuiteBase.RecordCaseRelativeItems(this.User2Information, this.User2Information.CalendarCollectionId, meetingRequestSubject);
            #endregion

            #region User2 calls SmartForward command to forward the calendar item to user3 with correct InstanceId value in SmartForward request
            string forwardFromUser = Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain);
            string forwardToUser   = Common.GetMailAddress(this.User3Information.UserName, this.User3Information.UserDomain);
            string forwardSubject  = string.Format("FW:{0}", meetingRequestSubject);
            string forwardContent  = Common.GenerateResourceName(Site, "forward:Meeting Instance body");
            SmartForwardRequest smartForwardRequest = this.CreateSmartForwardRequest(this.User2Information.CalendarCollectionId, calendarItemID, forwardFromUser, forwardToUser, string.Empty, string.Empty, forwardSubject, forwardContent);

            // Set instanceID with format the same as required format "2010-03-20T22:40:00.000Z".
            string instanceID = ConvertInstanceIdFormat(startTime);
            smartForwardRequest.RequestData.Source.InstanceId = instanceID;
            SmartForwardResponse smartForwardResponse = this.CMDAdapter.SmartForward(smartForwardRequest);
            Site.Assert.AreEqual(string.Empty, smartForwardResponse.ResponseDataXML, "If SmartForward command executes successfully, server should return empty xml data");
            #endregion

            #region After user2 forwards email to user3, sync user3 mailbox changes
            this.SwitchUser(this.User3Information);
            SyncResponse syncForwardResult   = this.GetMailItem(this.User3Information.InboxCollectionId, forwardSubject);
            string       forwardItemServerID = TestSuiteBase.FindServerId(syncForwardResult, "Subject", forwardSubject);

            // Sync user3 Calendar folder
            SyncResponse syncUser3CalendarFolder = this.GetMailItem(this.User3Information.CalendarCollectionId, forwardSubject);
            string       user3CalendarItemID     = TestSuiteBase.FindServerId(syncUser3CalendarFolder, "Subject", forwardSubject);

            // Record email items for clean up
            TestSuiteBase.RecordCaseRelativeItems(this.User3Information, this.User3Information.InboxCollectionId, forwardSubject);
            TestSuiteBase.RecordCaseRelativeItems(this.User3Information, this.User3Information.CalendarCollectionId, forwardSubject);
            #endregion

            #region Record the meeting forward notification mail which sent from server to User1.
            this.SwitchUser(this.User1Information);
            string notificationSubject = "Meeting Forward Notification: " + forwardSubject;
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, this.User1Information.DeletedItemsCollectionId, notificationSubject);
            this.GetMailItem(this.User1Information.DeletedItemsCollectionId, notificationSubject);
            #endregion

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R538
            // If the calendar item with specified subject exists in user3 Calendar folder and email item exists in user3 Inbox folder which means user3 gets the forwarded mail.
            Site.CaptureRequirementIfIsTrue(
                user3CalendarItemID != null && forwardItemServerID != null,
                538,
                @"[In SmartForward] When SmartForward is applied to a recurring meeting, the InstanceId element (section 2.2.3.83.2) specifies the ID of a particular occurrence in the recurring meeting.");
        }
예제 #6
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
        }
예제 #7
0
 /// <summary>
 /// Create a MeetingResponseRequest instance using specified MeetingResponseRequest array
 /// </summary>
 /// <param name="requests">Specified the MeetingResponseRequest array</param>
 /// <returns>A MeetingResponseRequest instance</returns>
 public static MeetingResponseRequest CreateMeetingResponseRequest(Request.MeetingResponseRequest[] requests)
 {
     MeetingResponseRequest request = new MeetingResponseRequest();
     Request.MeetingResponse requestData = new Request.MeetingResponse { Request = requests };
     request.RequestData = requestData;
     return request;
 }
 /// <summary>
 /// MeetingResponse for accepting or declining a MeetingRequest.
 /// </summary>
 /// <param name="meetingResponseRequest">The request for meeting.</param>
 /// <returns>The meeting response which is returned from server.</returns>
 public MeetingResponseResponse MeetingResponse(MeetingResponseRequest meetingResponseRequest)
 {
     MeetingResponseResponse response = this.activeSyncClient.MeetingResponse(meetingResponseRequest);
     Site.Assert.IsNotNull(response, "If the operation is successful, the response should not be null.");
     this.VerifyTransport();
     return response;
 }
 /// <summary>
 /// Accept, tentatively accept, or decline a meeting request in the user's Inbox folder or Calendar folder
 /// </summary>
 /// <param name="request">A MeetingResponseRequest object that contains the request information.</param>
 /// <returns>A MeetingResponseResponse object.</returns>
 public MeetingResponseResponse MeetingResponse(MeetingResponseRequest request)
 {
     MeetingResponseResponse response = this.activeSyncClient.MeetingResponse(request);
     Site.Assert.IsNotNull(response, "If the MeetingResponse command executes successfully, the response from server should not be null.");
     return response;
 }