ConvertInstanceIdFormat() public static method

Try to parse the no separator time string to DateTime
public static ConvertInstanceIdFormat ( string time ) : string
time string The specified DateTime string
return string
        public void MSASHTTP_S01_TC10_CommandParameter_Occurrence_PlainText()
        {
            #region User3 calls SendMail to send a meeting request to User2
            IDictionary <HTTPPOSTRequestPrefixField, string> requestPrefix = new Dictionary <HTTPPOSTRequestPrefixField, string>();
            string sendMailSubject   = Common.GenerateResourceName(this.Site, "SendMail");
            string smartReplySubject = Common.GenerateResourceName(this.Site, "SmartReply");

            // Call ConfigureRequestPrefixFields to change the QueryValueType.
            requestPrefix.Add(HTTPPOSTRequestPrefixField.QueryValueType, QueryValueType.PlainText.ToString());
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);

            // Switch the current user to user3 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserThreeInformation, true);

            // Call SendMail command to send the meeting request to User2.
            this.SendMeetingRequest(sendMailSubject);
            #endregion

            #region User2 calls SmartReply command to reply the request to User3 with Occurrence command parameter
            // Call ConfigureRequestPrefixFields to switch the credential to User2 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserTwoInformation, true);

            // Call Sync command to get the ServerId of the received meeting request.
            string itemServerId = this.LoopToSyncItem(this.UserTwoInformation.InboxCollectionId, sendMailSubject, true);

            // Add the received item to the item collection of User2.
            CreatedItems inboxItemForUserTwo = new CreatedItems
            {
                CollectionId = this.UserTwoInformation.InboxCollectionId
            };
            inboxItemForUserTwo.ItemSubject.Add(sendMailSubject);
            this.UserTwoInformation.UserCreatedItems.Add(inboxItemForUserTwo);

            // Call Sync command to get the ServerId of the calendar item.
            string calendarItemServerId = this.LoopToSyncItem(this.UserTwoInformation.CalendarCollectionId, sendMailSubject, true);

            CreatedItems calendarItemForUserTwo = new CreatedItems
            {
                CollectionId = this.UserTwoInformation.CalendarCollectionId
            };
            calendarItemForUserTwo.ItemSubject.Add(sendMailSubject);
            this.UserTwoInformation.UserCreatedItems.Add(calendarItemForUserTwo);

            // Call SmartReply command with the Occurrence command parameter.
            string startTime               = (string)this.GetElementValueFromSyncResponse(this.UserTwoInformation.CalendarCollectionId, calendarItemServerId, Response.ItemsChoiceType8.StartTime);
            string occurrence              = TestSuiteHelper.ConvertInstanceIdFormat(startTime);
            string userTwoMailboxAddress   = Common.GetMailAddress(this.UserTwoInformation.UserName, this.UserTwoInformation.UserDomain);
            string userThreeMailboxAddress = Common.GetMailAddress(this.UserThreeInformation.UserName, this.UserThreeInformation.UserDomain);
            this.CallSmartReplyCommand(userTwoMailboxAddress, userThreeMailboxAddress, itemServerId, smartReplySubject, null, null, occurrence);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R513
            // SmartReply command executed successfully with setting Occurrence command parameter, so this requirement can be captured.
            Site.CaptureRequirement(
                513,
                @"[In Command-Specific URI Parameters] [Parameter] Occurrence [is described as] A string that specifies the ID of a particular occurrence in a recurring meeting.");

            #endregion

            #region User3 gets the reply mail
            // Call ConfigureRequestPrefixFields to switch the credential to User3 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserThreeInformation, false);

            // Call Sync command to get the ServerId of the received the reply.
            this.LoopToSyncItem(this.UserThreeInformation.InboxCollectionId, smartReplySubject, true);
            this.AddCreatedItemToCollection("User3", this.UserThreeInformation.InboxCollectionId, smartReplySubject);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R529
            // SmartReply command executed successfully with setting Occurrence command parameter, so this requirement can be captured.
            Site.CaptureRequirement(
                529,
                @"[In Command-Specific URI Parameters] [Parameter] Occurrence [is used by] SmartReply.");
            #endregion

            #region Reset the query value type and user credential.
            requestPrefix[HTTPPOSTRequestPrefixField.QueryValueType] = Common.GetConfigurationPropertyValue("HeaderEncodingType", this.Site);
            HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);
            this.SwitchUser(this.UserOneInformation, false);
            #endregion
        }
        public void MSASHTTP_S01_TC09_CommandParameter_Occurrence_Base64()
        {
            #region User3 calls SendMail to send a meeting request to User2.
            IDictionary <HTTPPOSTRequestPrefixField, string> requestPrefix = new Dictionary <HTTPPOSTRequestPrefixField, string>();
            string sendMailSubject     = Common.GenerateResourceName(this.Site, "SendMail");
            string smartForwardSubject = Common.GenerateResourceName(this.Site, "SmartForward");

            // Call ConfigureRequestPrefixFields to change the QueryValueType to Base64.
            requestPrefix.Add(HTTPPOSTRequestPrefixField.QueryValueType, QueryValueType.Base64.ToString());
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);

            // Switch the current user to user3 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserThreeInformation, true);

            // Call SendMail command to send the meeting request to User2.
            this.SendMeetingRequest(sendMailSubject);
            #endregion

            #region User2 calls MeetingResponse command to accept the received meeting request and forward it to User1.
            // Call ConfigureRequestPrefixFields to switch the credential to User2 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserTwoInformation, true);

            // Call Sync command to get the ServerId of the received meeting request.
            string itemServerId = this.LoopToSyncItem(this.UserTwoInformation.InboxCollectionId, sendMailSubject, true);

            // Add the received item to the item collection of User2.
            CreatedItems inboxItemForUserTwo = new CreatedItems
            {
                CollectionId = this.UserTwoInformation.InboxCollectionId
            };
            inboxItemForUserTwo.ItemSubject.Add(sendMailSubject);
            this.UserTwoInformation.UserCreatedItems.Add(inboxItemForUserTwo);

            // Check the calendar item if is exist.
            string calendarItemServerId = this.LoopToSyncItem(this.UserTwoInformation.CalendarCollectionId, sendMailSubject, true);

            CreatedItems calendarItemForUserTwo = new CreatedItems
            {
                CollectionId = this.UserTwoInformation.CalendarCollectionId
            };
            calendarItemForUserTwo.ItemSubject.Add(sendMailSubject);
            this.UserTwoInformation.UserCreatedItems.Add(calendarItemForUserTwo);

            // Call MeetingResponse command to accept the received meeting request.
            this.CallMeetingResponseCommand(this.UserTwoInformation.InboxCollectionId, itemServerId);

            // The accepted meeting request will be moved to Delete Items folder.
            itemServerId = this.LoopToSyncItem(this.UserTwoInformation.DeletedItemsCollectionId, sendMailSubject, true);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R432
            // MeetingResponse command is executed successfully, so this requirement can be captured.
            Site.CaptureRequirementIfIsNotNull(
                itemServerId,
                432,
                @"[In Command Codes] [Command] MeetingResponse [is] used to accept [, tentatively accept , or decline] a meeting request in the user's Inbox folder.");

            // Remove the inboxItemForUserTwo object from the clean up list since it has been moved to Delete Items folder.
            this.UserTwoInformation.UserCreatedItems.Remove(inboxItemForUserTwo);
            this.AddCreatedItemToCollection("User2", this.UserTwoInformation.DeletedItemsCollectionId, sendMailSubject);

            // Call SmartForward command to forward the meeting to User1
            string startTime             = (string)this.GetElementValueFromSyncResponse(this.UserTwoInformation.CalendarCollectionId, calendarItemServerId, Response.ItemsChoiceType8.StartTime);
            string occurrence            = TestSuiteHelper.ConvertInstanceIdFormat(startTime);
            string userOneMailboxAddress = Common.GetMailAddress(this.UserOneInformation.UserName, this.UserOneInformation.UserDomain);
            string userTwoMailboxAddress = Common.GetMailAddress(this.UserTwoInformation.UserName, this.UserTwoInformation.UserDomain);
            this.CallSmartForwardCommand(userTwoMailboxAddress, userOneMailboxAddress, itemServerId, smartForwardSubject, null, null, occurrence);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R513
            // SmartForward command executed successfully with setting Occurrence command parameter, so this requirement can be captured.
            Site.CaptureRequirement(
                513,
                @"[In Command-Specific URI Parameters] [Parameter] Occurrence [is described as] A string that specifies the ID of a particular occurrence in a recurring meeting.");

            this.AddCreatedItemToCollection("User3", this.UserThreeInformation.DeletedItemsCollectionId, "Meeting Forward Notification: " + smartForwardSubject);
            #endregion

            #region User1 gets the forwarded meeting request
            // Call ConfigureRequestPrefixFields to switch the credential to User1 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserOneInformation, true);

            this.AddCreatedItemToCollection("User1", this.UserOneInformation.InboxCollectionId, smartForwardSubject);
            this.AddCreatedItemToCollection("User1", this.UserOneInformation.CalendarCollectionId, smartForwardSubject);

            // Call Sync command to get the ServerId of the received meeting request.
            this.LoopToSyncItem(this.UserOneInformation.InboxCollectionId, smartForwardSubject, true);

            // Call Sync command to get the ServerId of the calendar item.
            this.LoopToSyncItem(this.UserOneInformation.CalendarCollectionId, smartForwardSubject, true);
            #endregion

            #region User3 gets the Meeting Forward Notification email in the Deleted Items folder.
            // Call ConfigureRequestPrefixFields to switch the credential to User3 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserThreeInformation, false);

            // Call Sync command to get the ServerId of the received meeting request and the notification email.
            this.LoopToSyncItem(this.UserThreeInformation.DeletedItemsCollectionId, "Meeting Forward Notification: " + smartForwardSubject, true);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R119
            // SmartForward command executed successfully with setting Occurrence command parameter, so this requirement can be captured.
            Site.CaptureRequirement(
                119,
                @"[In Command-Specific URI Parameters] [Parameter] Occurrence [is used by] SmartForward.");
            #endregion

            #region Reset the query value type.
            requestPrefix[HTTPPOSTRequestPrefixField.QueryValueType] = Common.GetConfigurationPropertyValue("HeaderEncodingType", this.Site);
            HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);
            #endregion
        }