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

MSASEMAIL_S03_TC07_AddFlag_InvalidDate() private method

private MSASEMAIL_S03_TC07_AddFlag_InvalidDate ( ) : void
return void
        public void MSASEMAIL_S03_TC07_AddFlag_InvalidDate()
        {
            #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 and just set the value of StartDate and DueDate.
            Request.Flag flag = new Request.Flag
            {
                Status = "2",
                FlagType = "for Follow Up",
                StartDate = DateTime.Now,
                StartDateSpecified = true,
                DueDate = DateTime.Now.AddDays(20),
                DueDateSpecified = true
            };

            // Get the synchronization result
            SyncStore getEmailItem = this.GetSyncResult(emailSubject, this.User2Information.InboxCollectionId, null);

            // Get the new added email item
            Sync emailItem = TestSuiteHelper.GetSyncAddItem(getEmailItem, emailSubject);

            // Add flag to the email item
            SyncStore updateResult = this.UpdateEmail(this.User2Information.InboxCollectionId, getEmailItem.SyncKey, null, emailItem.ServerId, flag, null);

            Site.Assert.AreEqual<int>(
                6,
                int.Parse(updateResult.ChangeResponses[0].Status),
                "The server should return a Status 6 in the Sync command response if the the request just sets StartDate and DueDate.");
            #endregion

            #region Verify requirements
            // If the server returns a Status element value of 6 in the Sync command response, then MS-ASEMAIL_R409, MS-ASEMAIL_R864 and MS-ASEMAIL_R853 can be captured.
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R409");

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R409
            Site.CaptureRequirement(
                409,
                @"[In DueDate] The server returns a Status element value of 6 in the Sync response if this condition[To set a flag, the tasks:StartDate element, tasks:DueDate element, tasks:UtcStartDate element (section 2.2.2.75), and tasks:UtcDueDate element (section 2.2.2.74) either all MUST be set, or all MUST be NULL.] is not met.");

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

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R864
            Site.CaptureRequirement(
                864,
                @"[In UtcStartDate] The server returns a Status element value of 6 in the Sync command response if this condition[To set a flag, the tasks:StartDate element, tasks:DueDate element (section 2.2.2.24), tasks:UtcStartDate element, and tasks:UtcDueDate element either all MUST be set, or all MUST be NULL. ] is not met.");

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

            // Verify MS-ASEMAIL requirement: MS-ASEMAIL_R853
            Site.CaptureRequirement(
                853,
                @"[In UtcDueDate] The server returns a Status element value of 6 in the Sync command response if this condition[To set a flag, the tasks:StartDate element (section 2.2.2.72), tasks:DueDate element, tasks:UtcStartDate element, and tasks:UtcDueDate element either all MUST be set, or all MUST be NULL.] is not met.");
            #endregion
        }
        #endregion
S03_EmailFlag