A class contains all helper methods used in test cases.
Example #1
0
        public void MSOXWSTASK_S06_TC03_OperateTaskItemWithIsCompleteElement()
        {
            #region Client calls CreateItem operation to create a task item with task Status equal to Completed.
            // 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, TaskStatusType.Completed));
            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 IsComplete element value
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSTASK_R5555");

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R5555
            this.Site.CaptureRequirementIfIsTrue(
                retrievedTaskItemFirst.IsComplete,
                5555,
                @"[In t:TaskType Complex Type] [IsComplete is] True, indicates a task has been completed.");

            #endregion

            #region Client calls CreateItem operation to create a task item with task Status equal to InProgress.
            // 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, TaskStatusType.InProgress));
            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 IsComplete element value

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R5556
            this.Site.CaptureRequirementIfIsFalse(
                retrievedTaskItemSecond.IsComplete,
                5556,
                @"[In t:TaskType Complex Type] [IsComplete is] False, indicates a task has not been completed.");

            #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
        }
        public void MSOXWSTASK_S04_TC01_VerifyMoveTaskItem()
        {
            #region Client calls CreateItem to create a task item on server. By default, it is created in task folder.
            string       subject       = Common.GenerateResourceName(this.Site, "This is a task");
            ItemIdType[] createItemIds = 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 createItemId = createItemIds[0];
            #endregion

            #region Client calls MoveItem to move the task item to deleteditems folder.
            ItemIdType[] moveItemIds = this.MoveTasks(createItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This move response status should be success!", null);
            ItemIdType moveItemId = moveItemIds[0];
            #endregion

            #region Client calls GetItem to check whether the task item is moved.
            this.GetTasks(createItemId);
            Site.Assert.AreNotEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should not be success! The created task has been moved.", null);
            this.GetTasks(moveItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should be success!", null);
            #endregion

            #region Client calls DeleteItem to delete the task item created in the previous steps.
            this.DeleteTasks(moveItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status should be success!", null);
            #endregion
        }
Example #3
0
        /// <summary>
        /// Delete tasks on the server according to items' id.
        /// </summary>
        /// <param name="itemIds">The item id of tasks which will be deleted.</param>
        protected void DeleteTasks(params ItemIdType[] itemIds)
        {
            // Define the DeleteItem request.
            DeleteItemType deleteItemRequest = TestSuiteHelper.GenerateDeleteItemRequest(itemIds);

            // Call the DeleteItem method to delete the task items created in previous steps.
            DeleteItemResponseType deleteItemResponse = this.TASKAdapter.DeleteItem(deleteItemRequest);

            this.VerifyResponseMessage(deleteItemResponse);
        }
Example #4
0
        /// <summary>
        /// Get tasks on the server according to items' id.
        /// </summary>
        /// <param name="itemIds">The item id of task which will be gotten.</param>
        /// <returns>The got task items array.</returns>
        protected TaskType[] GetTasks(params ItemIdType[] itemIds)
        {
            GetItemType getItemRequest = TestSuiteHelper.GenerateGetItemRequest(itemIds);

            // Get the GetItem response from the server by using the ItemId got from createItem response.
            GetItemResponseType getItemResponse = this.TASKAdapter.GetItem(getItemRequest);

            this.VerifyResponseMessage(getItemResponse);

            return(Common.GetItemsFromInfoResponse <TaskType>(getItemResponse));
        }
        public void MSOXWSTASK_S05_TC01_OperateMultipleTaskItems()
        {
            #region Client calls CreateItem to create two task items on server.
            string       firstSubject  = Common.GenerateResourceName(this.Site, "This is a task", 1);
            string       secondSubject = Common.GenerateResourceName(this.Site, "This is a task", 2);
            ItemIdType[] createItemIds = this.CreateTasks(TestSuiteHelper.DefineTaskItem(firstSubject), TestSuiteHelper.DefineTaskItem(secondSubject));
            Site.Assert.IsNotNull(createItemIds, "This create response should have task item id!");
            Site.Assert.AreEqual <int>(2, createItemIds.Length, "There should be 2 task items' ids in response!");
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This create response status of first task item should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This create response status of second task item should be success!", null);
            #endregion

            #region Client calls GetItem to get two task items.
            TaskType[] taskItems = this.GetTasks(createItemIds);
            Site.Assert.IsNotNull(taskItems, "This get response should have task items!");
            Site.Assert.AreEqual <int>(2, taskItems.Length, "There should be 2 task items in response!");
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status of first task item should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This get response status of second task item should be success!", null);
            #endregion

            #region Client calls UpdateItem to update the value of taskCompanies element of task item.
            ItemIdType[] updateItemIds = this.UpdateTasks(createItemIds);
            Site.Assert.IsNotNull(updateItemIds, "This update response should have task item id!");
            Site.Assert.AreEqual <int>(2, updateItemIds.Length, "There should be 2 task items' ids in response!");
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This update response status of first task item should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This update response status of second task item should be success!", null);
            #endregion

            #region Client calls CopyItem to copy the two task items.
            ItemIdType[] copyItemIds = this.CopyTasks(updateItemIds);
            Site.Assert.IsNotNull(copyItemIds, "This copy response should have task item id!");
            Site.Assert.AreEqual <int>(2, copyItemIds.Length, "There should be 2 task items' ids in response!");
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This copy response status of first task item should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This copy response status of second task item should be success!", null);
            #endregion

            #region Client calls MoveItem to move the task items to deleteditems folder
            ItemIdType[] moveItemIds = this.MoveTasks(updateItemIds);
            Site.Assert.IsNotNull(moveItemIds, "This move response should have task item id!");
            Site.Assert.AreEqual <int>(2, moveItemIds.Length, "There should be 2 task items' ids in response!");
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This move response status of first task item should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This move response status of second task item should be success!", null);
            #endregion

            #region Client calls DeleteItem to delete the task items created in the previous steps.
            ItemIdType[] deleteItemIds = new ItemIdType[copyItemIds.Length + moveItemIds.Length];
            copyItemIds.CopyTo(deleteItemIds, 0);
            moveItemIds.CopyTo(deleteItemIds, copyItemIds.Length);
            this.DeleteTasks(deleteItemIds);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status of first task item should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This delete response status of second task item should be success!", null);
            #endregion
        }
Example #6
0
        /// <summary>
        /// Creates tasks on the server and extracts the items id from response.
        /// </summary>
        /// <param name="taskItems">The task items which will be created.</param>
        /// <returns>The extracted items id array.</returns>
        protected ItemIdType[] CreateTasks(params TaskType[] taskItems)
        {
            // Configure the CreateItem request.
            CreateItemType createItemRequest = TestSuiteHelper.GenerateCreateItemRequest(taskItems);

            // Get the CreateItem response from server.
            CreateItemResponseType createItemResponse = this.TASKAdapter.CreateItem(createItemRequest);

            this.VerifyResponseMessage(createItemResponse);

            // Save the ItemId of task item got from the createItem response.
            return(Common.GetItemIdsFromInfoResponse(createItemResponse));
        }
Example #7
0
        /// <summary>
        /// Update tasks on the server according to items' id.
        /// </summary>
        /// <param name="itemIds">The item id of tasks which will be updated.</param>
        /// <returns>The extracted items id array.</returns>
        protected ItemIdType[] UpdateTasks(params ItemIdType[] itemIds)
        {
            // Define the UpdateItem request.
            UpdateItemType updateItemRequest = TestSuiteHelper.GenerateUpdateItemRequest(itemIds);

            // Call the UpdateItem method to update the task items created in previous steps.
            UpdateItemResponseType updateItemResponse = this.TASKAdapter.UpdateItem(updateItemRequest);

            this.VerifyResponseMessage(updateItemResponse);

            // Save the ItemId of task item got from the updateItem response.
            return(Common.GetItemIdsFromInfoResponse(updateItemResponse));
        }
        public void MSOXWSTASK_S03_TC01_VerifyCopyTaskItem()
        {
            #region Client calls CreateItem to create a task item on server.
            string       subject       = Common.GenerateResourceName(this.Site, "This is a task");
            ItemIdType[] createItemIds = 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 createItemId = createItemIds[0];
            #endregion

            #region Client calls CopyItem to copy the task item.
            ItemIdType[] copyItemIds = this.CopyTasks(createItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This copy response status should be success!", null);
            ItemIdType copyItemId = copyItemIds[0];
            #endregion

            #region Client calls DeleteItem to delete the created and copied task items.
            this.DeleteTasks(createItemId, copyItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status should be success!", null);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[1], "This delete response status should be success!", null);
            #endregion
        }
Example #9
0
        public void MSOXWSTASK_S06_TC02_OperateTaskItemWithOptionalElements()
        {
            #region Client calls CreateItem operation to create a task item with optional elements.

            // All the optional elements in task item are set in this method.
            string   subject      = Common.GenerateResourceName(this.Site, "This is a task");
            TaskType sentTaskItem = TestSuiteHelper.DefineTaskItem(subject, TaskStatusType.Completed);

            // Save the ItemId of task item got from the createItem response.
            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 call GetItem operation to get the task item.
            TaskType[] retrievedTaskItems = this.GetTasks(createItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This get response status should be success!", null);
            TaskType retrievedTaskItem = retrievedTaskItems[0];
            #endregion

            #region Verify the related requirements about sub-elements of TaskType
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSTASK_R42");

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R42
            this.Site.CaptureRequirementIfAreEqual <int>(
                sentTaskItem.ActualWork,
                retrievedTaskItem.ActualWork,
                42,
                @"[In t:TaskType Complex Type] ActualWork: Specifies an integer value that specifies the actual amount of time that is spent on a task.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R44
            this.Site.CaptureRequirementIfAreEqual <string>(
                sentTaskItem.BillingInformation,
                retrievedTaskItem.BillingInformation,
                44,
                @"[In t:TaskType Complex Type] BillingInformation: Specifies a string value that contains billing information for a task.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSTASK_R47, Expected value:" + sentTaskItem.Companies[0].ToString() + " " + sentTaskItem.Companies[1].ToString() + "Actual value:" + retrievedTaskItem.Companies[0].ToString() + " " + retrievedTaskItem.Companies[1].ToString());

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R47
            bool isVerifiedR47 = TestSuiteHelper.CompareStringArray(retrievedTaskItem.Companies, sentTaskItem.Companies);

            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR47,
                47,
                @"[In t:TaskType Complex Type] Companies: Specifies an instance of an array of type string that represents a collection of companies that are associated with a task.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSTASK_R49, Expected value" + sentTaskItem.Contacts[0].ToString() + " " + sentTaskItem.Contacts[1].ToString() + "Actual value:" + retrievedTaskItem.Contacts[0].ToString() + " " + retrievedTaskItem.Contacts[1].ToString());

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R49
            bool isVerifiedR49 = TestSuiteHelper.CompareStringArray(retrievedTaskItem.Contacts, sentTaskItem.Contacts);

            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR49,
                49,
                @"[In t:TaskType Complex Type] Contacts: Specifies an instance of an array of type string that contains a list of contacts that are associated with a task.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R53
            this.Site.CaptureRequirementIfAreEqual <DateTime>(
                sentTaskItem.DueDate.Date,
                retrievedTaskItem.DueDate.Date,
                53,
                @"[In t:TaskType Complex Type] DueDate: Specifies an instance of the DateTime structure that represents the date when a task is due.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R58
            this.Site.CaptureRequirementIfAreEqual <string>(
                sentTaskItem.Mileage,
                retrievedTaskItem.Mileage,
                58,
                @"[In t:TaskType Complex Type] Mileage: Specifies a string value that represents the mileage for a task.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R63
            this.Site.CaptureRequirementIfAreEqual <DateTime>(
                sentTaskItem.StartDate.Date,
                retrievedTaskItem.StartDate.Date,
                63,
                @"[In t:TaskType Complex Type] StartDate: Specifies an instance of the DateTime structure that represents the start date of a task.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R65
            this.Site.CaptureRequirementIfAreEqual <TaskStatusType>(
                sentTaskItem.Status,
                retrievedTaskItem.Status,
                65,
                @"[In t:TaskType Complex Type] Status: Specifies one of the valid TaskStatusType simple type enumeration values that represent the status of a task.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R67
            this.Site.CaptureRequirementIfAreEqual <int>(
                sentTaskItem.TotalWork,
                retrievedTaskItem.TotalWork,
                67,
                @"[In t:TaskType Complex Type] TotalWork: Specifies an integer value that represents the total amount of work that is associated with a task.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R45
            this.Site.CaptureRequirementIfAreEqual <int>(
                sentTaskItem.ChangeCount + 1,
                retrievedTaskItem.ChangeCount,
                45,
                @"[In t:TaskType Complex Type] ChangeCount: Specifies an integer value that specifies the number of times the task has changed since it was created.");

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

            // Verify MS-OXWSTASK requirement: MS-OXWSTASK_R48
            this.Site.CaptureRequirementIfAreEqual <DateTime>(
                sentTaskItem.CompleteDate.Date,
                retrievedTaskItem.CompleteDate.Date,
                48,
                @"[In t:TaskType Complex Type] CompleteDate: Specifies an instance of the DateTime structure that represents the date on which a task was completed.");

            #endregion

            #region Client calls UpdateItem operation to update the value of taskCompanies 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 CopyItem operation to copy the created task item.
            ItemIdType[] copyItemIds = this.CopyTasks(updateItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This copy response status should be success!", null);
            ItemIdType copyItemId = copyItemIds[0];
            #endregion

            #region Client calls MoveItem operation to move the task item.
            ItemIdType[] moveItemIds = this.MoveTasks(updateItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This move response status should be success!", null);
            ItemIdType moveItemId = moveItemIds[0];
            #endregion

            #region Client calls DeleteItem to delete the task items created in the previous steps.
            this.DeleteTasks(copyItemId, moveItemId);
            Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, (ResponseClassType)this.ResponseClass[0], "This delete response status should be success!", null);
            #endregion
        }
Example #10
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
        }
Example #11
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
        }