Microsoft.Protocols.TestSuites.MS_ASEMAIL.S03_EmailFlag.MSASEMAIL_S03_TC01_AddFlag_AllElements C# (CSharp) Method

MSASEMAIL_S03_TC01_AddFlag_AllElements() private method

private MSASEMAIL_S03_TC01_AddFlag_AllElements ( ) : void
return void
        public void MSASEMAIL_S03_TC01_AddFlag_AllElements()
        {
            #region Call SendMail command to send an email.
            string emailSubject = Common.GenerateResourceName(Site, "subject");
            this.SendPlaintextEmail(emailSubject, string.Empty, string.Empty);
            #endregion

            #region Call Sync command with Change element to add flag with all flag child elements.
            DateTime startDate = DateTime.Now;
            DateTime dueDate = DateTime.Now.AddDays(20);

            // Create flag element with all properties
            Request.Flag flag = new Request.Flag
            {
                Status = "2",
                FlagType = "for Follow Up",
                Subject = Common.GenerateResourceName(Site, "FlagSubject"),
                StartDate = startDate,
                StartDateSpecified = true,
                UtcStartDate = startDate.ToUniversalTime(),
                UtcStartDateSpecified = true,
                DueDate = dueDate,
                DueDateSpecified = true,
                UtcDueDate = dueDate.ToUniversalTime(),
                UtcDueDateSpecified = true,
                OrdinalDate = DateTime.Now,
                OrdinalDateSpecified = true,
                ReminderSet = 1,
                ReminderSetSpecified = true,
                ReminderTime = DateTime.Now.AddDays(12),
                ReminderTimeSpecified = true,
                CompleteTime = DateTime.Now.AddDays(30),
                CompleteTimeSpecified = true,
                DateCompleted = DateTime.Now.AddDays(30),
                DateCompletedSpecified = true
            };

            flag.SubOrdinalDate = flag.OrdinalDate.ToString();

            // Get the email item
            SyncStore getEmailItem = this.GetSyncResult(emailSubject, this.User2Information.InboxCollectionId, null);
            Sync item = TestSuiteHelper.GetSyncAddItem(getEmailItem, emailSubject);
            Site.Assert.IsNotNull(item, "The message with subject {0} should be found in the folder {1} of user {2}.", emailSubject, FolderType.Inbox.ToString(), this.User2Information.UserName);

            // Add flag to an email item
            SyncStore getChangedResult = this.AddEmailFag(this.User2Information, getEmailItem, emailSubject, flag);
            item = TestSuiteHelper.GetSyncChangeItem(getChangedResult, item.ServerId);
            Site.Assert.IsNotNull(item, "The message with subject {0} should be found in the folder {1} of user {2}.", emailSubject, FolderType.Inbox.ToString(), this.User2Information.UserName);
            #endregion

            #region Verify requirements
            if (Common.IsRequirementEnabled(1007, this.Site))
            {
                // Because MS-ASEMAIL doesn't test sorting, if the Sync command succeeds and the response contains a SubOrdinalDate value, then MS-ASEMAIL_R1007 can be captured.
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R1007");

                // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R1007
                Site.CaptureRequirementIfIsNotNull(
                    item.Email.Flag.SubOrdinalDate,
                    1007,
                    @"[In Appendix B: Product Behavior] It[tasks:SubOrdinalDate] can contain any string value and is used for sorting if there are duplicate tasks:OrdinalDate element (section 2.2.2.45) values. (Exchange Server 2007 SP1 and above follow this behavior.)");
            }

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

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R692
            Site.CaptureRequirementIfAreEqual<byte>(
                1,
                item.Email.Flag.ReminderSet,
                692,
                @"[In ReminderSet] The value of this element[tasks:ReminderSet] is set to 1 if a reminder has been set for the task.");
            #endregion
        }
        #endregion
S03_EmailFlag