GenerateTaskRecurrence() public static méthode

Generate the task recurrence used by TaskType.
public static GenerateTaskRecurrence ( GenerateRecurPattern generateRecurPatternMethod, GenerateRecurRange generateRecurRangeMethod ) : TaskRecurrenceType
generateRecurPatternMethod GenerateRecurPattern The method to generate recurrence pattern type.
generateRecurRangeMethod GenerateRecurRange The method to generate recurrence range type.
Résultat Microsoft.Protocols.TestSuites.Common.TaskRecurrenceType
Exemple #1
0
        public void MSOXWSTASK_S06_TC04_OperateTaskItemWithIsRecurringElement()
        {
            #region Client calls CreateItem operation to create a task item, which is a recurring task.
            // Configure the DailyRegeneratingPatternType.
            TaskRecurrenceType taskRecurrence = TestSuiteHelper.GenerateTaskRecurrence(TestSuiteHelper.GenerateDailyRegeneratingPattern, TestSuiteHelper.GenerateNumberedRecurrenceRange);

            // Save the ItemId of task item got from the createItem response.
            string       subject            = Common.GenerateResourceName(this.Site, "This is a task");
            ItemIdType[] createItemIdsFirst = this.CreateTasks(TestSuiteHelper.DefineTaskItem(subject, taskRecurrence));
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This create response status should be success!", null);
            ItemIdType createItemIdFirst = createItemIdsFirst[0];
            #endregion

            #region Client call GetItem operation to get the task item.
            TaskType[] retrievedTaskItemsFirst = this.GetTasks(createItemIdFirst);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should be success!", null);
            TaskType retrievedTaskItemFirst = retrievedTaskItemsFirst[0];
            #endregion

            #region Verify the IsRecurring element value

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R5666
            this.Site.CaptureRequirementIfIsTrue(
                retrievedTaskItemFirst.IsRecurring,
                5666,
                @"[In t:TaskType Complex Type] [IsRecurring is] True, indicates a task is part of a recurring task.");

            #endregion

            #region Client calls CreateItem operation to create a task item, which is not a recurring task.
            // Save the ItemId of task item got from the createItem response.
            subject = Common.GenerateResourceName(this.Site, "This is a task");
            ItemIdType[] createItemIdsSecond = this.CreateTasks(TestSuiteHelper.DefineTaskItem(subject, null));
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This create response status should be success!", null);
            ItemIdType createItemIdSecond = createItemIdsSecond[0];
            #endregion

            #region Client call GetItem operation to get the task item.
            TaskType[] retrievedTaskItemsSecond = this.GetTasks(createItemIdSecond);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should be success!", null);
            TaskType retrievedTaskItemSecond = retrievedTaskItemsSecond[0];
            #endregion

            #region Verify the IsRecurring element value

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R5667
            this.Site.CaptureRequirementIfIsFalse(
                retrievedTaskItemSecond.IsRecurring,
                5667,
                @"[In t:TaskType Complex Type] [IsRecurring is] False, indicates a task is not part of a recurring task.");

            #endregion

            #region Client calls DeleteItem to delete the task items created in the previous steps.
            this.DeleteTasks(createItemIdFirst, createItemIdSecond);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status should be success!", null);
            #endregion
        }
Exemple #2
0
        public void MSOXWSTASK_S02_TC01_VerifyAffectedTaskOccurrencesType()
        {
            #region Client calls CreateItem to create a task item that contains the Recurrence element, which includes the DailyRecurrencePatternType.

            // Configure the DailyRecurrencePatternType.
            TaskRecurrenceType taskRecurrence = TestSuiteHelper.GenerateTaskRecurrence(TestSuiteHelper.GenerateDailyRecurrencePattern, TestSuiteHelper.GenerateNumberedRecurrenceRange);

            // Define a task item.
            string   subject      = Common.GenerateResourceName(this.Site, "This is a task");
            TaskType sentTaskItem = TestSuiteHelper.DefineTaskItem(subject, taskRecurrence);

            ItemIdType[] createItemIds = this.CreateTasks(sentTaskItem);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This create response status should be success!", null);
            ItemIdType createItemId = createItemIds[0];
            #endregion

            #region Client calls UpdateItem to update the value of "companies" element of task item.
            ItemIdType[] updateItemIds = this.UpdateTasks(createItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This update response status should be success!", null);
            ItemIdType updateItemId = updateItemIds[0];
            #endregion

            #region Client calls GetItem to check whether the task item' "companies" element is updated.
            TaskType[] taskItemsAfterUpdate = this.GetTasks(updateItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should be success!", null);
            TaskType taskItemAfterUpdate = taskItemsAfterUpdate[0];
            bool     isEqual             = TestSuiteHelper.CompareStringArray(taskItemAfterUpdate.Companies, new string[] { "Company3", "Company4" });
            Site.Assert.IsTrue(isEqual, "After updated, the task companies names should be Company3, Company4", null);
            #endregion

            #region Client calls DeleteItem to delete only the current occurrence of a task.
            this.DeleteTasks(AffectedTaskOccurrencesType.SpecifiedOccurrenceOnly, updateItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status should be success!", null);
            #endregion

            #region Client calls GetItem to check whether only current occurrence of task item is deleted.

            TaskType[] taskItemsAfterDelete = GetTasks(updateItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should be success!", null);
            TaskType taskItemAfterDelete = taskItemsAfterDelete[0];

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R175
            // After deleting the current occurrence of a task item, the start time of task item is changed to next occurrence.
            Site.CaptureRequirementIfAreEqual <string>(
                ExtractStartTimeOfNextOccurrence(taskItemAfterUpdate),
                taskItemAfterDelete.StartDate.ToShortTimeString(),
                175,
                @"[In t:AffectedTaskOccurrencesType Simple Type]  SpecifiedOccurrenceOnly: Specifies that a DeleteItem operation request, as specified in [MS-OXWSCORE] section 3.1.4.3, deletes only the current occurrence of a task.");

            #endregion

            #region Client calls DeleteItem to delete all recurring tasks.
            this.DeleteTasks(updateItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status should be success!", null);
            #endregion

            #region Client calls GetItem to check whether all recurring tasks is deleted.
            this.GetTasks(updateItemId);
            Site.Assert.AreNotEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should not be success!", null);
            Site.Assert.AreEqual <ResponseCodeType>(ResponseCodeType.ErrorItemNotFound, (ResponseCodeType)this.ResponseCode[0], "This get response status information should be ErrorItemNotFound!", null);

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R174
            // After deleting all recurring tasks with the AffectedTaskOccurrences element setting to AllOccurrences,
            // the operation of getting task will return code ErrorItemNotFound. If getting this response code, the following
            // requirement will be captured directly.
            Site.CaptureRequirement(
                174,
                @"[In t:AffectedTaskOccurrencesType Simple Type] AllOccurrences: Specifies that a DeleteItem operation request, as specified in [MS-OXWSCORE] section 3.1.4.3, deletes the master task and all recurring tasks that are associated with the master task.");

            #endregion
        }