Ejemplo n.º 1
0
        public void MSWWSP_S02_TC03_GetWorkflowDataForItem()
        {
            // Upload a file.
            string uploadFileUrl = this.UploadFileToSut(DocLibraryName);

            // Start a normal work flow
            string taskIdValue = this.StartATaskWithNewFile(uploadFileUrl, false);

            this.Site.Assert.IsNotNull(taskIdValue, "Starting a workflow task should succeed.");

            // Call method GetWorkflowDataForItem to query a set of workFlow associations, workFlow tasks, and workFlows for a document.
            GetWorkflowDataForItemResponseGetWorkflowDataForItemResult workflowDataResult = ProtocolAdapter.GetWorkflowDataForItem(uploadFileUrl);

            if (workflowDataResult == null || workflowDataResult.WorkflowData == null)
            {
                this.Site.Assume.Fail("GetWorkflowDataForItem operation is failed, the response is not be returned.");
            }

            this.Site.Assert.IsTrue(workflowDataResult.WorkflowData.DefaultWorkflows != null &&
                                    workflowDataResult.WorkflowData.DefaultWorkflows.DefaultWorkflow != null, "DefaultWorkflow should be present.");

            // Verify MS-WWSP requirement: MS-WWSP_R290
            Site.CaptureRequirementIfAreEqual <string>(
                "OnCheckInMajor",
                workflowDataResult.WorkflowData.DefaultWorkflows.DefaultWorkflow.Event,
                290,
                @"[In GetWorkflowDataForItemResponse] GetWorkflowDataForItemResult.WorkflowData.DefaultWorkflows.DefaultWorkflow.Event: MUST be set to ""OnCheckInMajor"".");

            // Verify MS-WWSP requirement: MS-WWSP_R198
            // If the response from the GetWorkflowDataForItem operation is not null, then R198 should be covered.
            Site.CaptureRequirementIfIsNotNull(
                workflowDataResult.WorkflowData,
                198,
                @"[In GetWorkflowDataForItem] The protocol client sends a GetWorkflowDataForItemSoapIn request message, and the protocol server responds with a GetWorkflowDataForItemSoapOut response message.");

            // If the element of the ActiveWorkflowsData is not null, then R220 should be covered.
            // Verify MS-WWSP requirement: MS-WWSP_R220
            Site.CaptureRequirementIfIsNotNull(
                workflowDataResult.WorkflowData.ActiveWorkflowsData,
                220,
                @"[In GetWorkflowDataForItemResponse] GetWorkflowDataForItemResult.WorkflowData.ActiveWorkflowsData: A set of workflows running on the document.");

            if (workflowDataResult.WorkflowData.ToDoData == null || workflowDataResult.WorkflowData.ToDoData.xml.data.Any.Length == 0)
            {
                this.Site.Assume.Fail("GetWorkflowDataForItem operation is failed, the element ToDoData is not be returned.");
            }

            if (workflowDataResult.WorkflowData.TemplateData == null)
            {
                this.Site.Assume.Fail("GetWorkflowDataForItem operation is failed, the element TemplateData is not be returned.");
            }

            // If the element of the StatusPageUrl is not null, then R221 should be covered.
            // Verify MS-WWSP requirement: MS-WWSP_R221
            Site.CaptureRequirementIfIsNotNull(
                workflowDataResult.WorkflowData.ActiveWorkflowsData.Workflows[0].StatusPageUrl,
                221,
                @"[In GetWorkflowDataForItemResponse] GetWorkflowDataForItemResult.WorkflowData.ActiveWorkflowsData.Workflows.Workflow.StatusPageUrl: The URL of a Web page that can show the status of a workflow.");

            // If the element ToDoData, TemplateData and ActiveWorkflowsData are all not null, then R410 should be covered.
            Site.CaptureRequirement(
                410,
                @"[In Message Processing Events and Sequencing Rules] GetWorkflowDataForItem obtains an aggregated set of workflows, workflow associations, and workflow tasks for an existing document.");

            // If the element ToDoData, TemplateData and ActiveWorkflowsData are all not null, then R195 should be covered.
            Site.CaptureRequirement(
                195,
                @"[In GetWorkflowDataForItem] This operation[GetWorkflowDataForItem] queries a set of workflow associations, workflow tasks, and workflows for a document.");

            // If the element ToDoData, TemplateData and ActiveWorkflowsData are all not null, then R201 should be covered.
            Site.CaptureRequirement(
                201,
                @"[In Messages] GetWorkflowDataForItemSoapOut specifies the response to a request to query a set of workflow associations, workflow tasks, and workflows for a document.");

            // If the element ToDoData, TemplateData and ActiveWorkflowsData are all not null, then R210 should be covered.
            Site.CaptureRequirement(
                210,
                @"[In Elements] GetWorkflowDataForItemResponse contains the response to a request to query a set of workflow associations, workflow tasks, and workflows for a document.");

            // If the TemplateId is equal to the specific value, then R224 and R225 should be covered.
            // Verify MS-WWSP requirement: MS-WWSP_R224
            Site.CaptureRequirementIfAreEqual(
                new Guid(WorkflowAssociationId),
                workflowDataResult.WorkflowData.ActiveWorkflowsData.Workflows[0].TemplateId,
                224,
                @"[In GetWorkflowDataForItemResponse] GetWorkflowDataForItemResult.WorkflowData.ActiveWorkflowsData. Workflows.Workflow.TemplateId: A GUID identifying the workflow association of a workflow.");

            // Verify MS-WWSP requirement: MS-WWSP_R225
            Site.CaptureRequirementIfAreEqual(
                new Guid(WorkflowAssociationId),
                workflowDataResult.WorkflowData.ActiveWorkflowsData.Workflows[0].TemplateId,
                225,
                @"[In GetWorkflowDataForItemResponse] This[GetWorkflowDataForItemResult.WorkflowData.ActiveWorkflowsData. Workflows.Workflow.TemplateId] MUST be the workflow association of the workflow specified by Workflow.Id.");
        }