public void Run_WorkFlow_3Dv_createCross_link_a3d_Case1686()  //  //case 1.9.3_WorkFlow_3Dv_createCross_link_a3d
        {
            int runCount = 0;

            foreach (InputDataSet ids in this.Input.DataSets)
            {
                runCount++;
                Round r = this.NewRound(runCount.ToString(), ids.Description);

                try
                {
                    #region Parameter initialize

                    string volumeID = "";
                    //for create volume
                    XMLParameter cSeriesData = new XMLParameter("series");
                    XMLParameter cVolumeData = new XMLParameter("volume");
                    XMLParameter cSlicePathData = new XMLParameter("slices_path_list");
                    //for create study
                    XMLParameter studyPara = new XMLParameter("request");
                    XMLParameter xmlAnalysisInfo = new XMLParameter("analysis3d");
                    //for create cross section
                    XMLParameter crosssection = new XMLParameter("crosssection");
                    XMLParameter slicesPathList = new XMLParameter("slices_path_list");
                    XMLParameter slicesPSAnnotationList = new XMLParameter("slices_ps_xml_annotation_list");
                    XMLParameter slicesPSGeneralList = new XMLParameter("slices_ps_xml_general_list");
                    XMLParameter slicesPSProcessingList = new XMLParameter("slices_ps_xml_processing_list");
                    XMLParameter slicesThumbnailList = new XMLParameter("slices_ps_thumbnail_path_list");

                    for (int i = 0; i < ids.InputParameters.Count; i++)
                    {
                        switch (ids.InputParameters.GetParameter(i).Step)
                        {
                            case "series":
                                cSeriesData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "volume":
                                cVolumeData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "slices_path_list":
                                cSlicePathData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "study":
                                studyPara.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "seta3d":
                                xmlAnalysisInfo.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "create_crossSection":
                                crosssection.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "create_slices_path_list":
                                slicesPathList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "create_slices_ps_xml_annotation_list":
                                slicesPSAnnotationList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "create_slices_ps_xml_general_list":
                                slicesPSGeneralList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "create_slices_ps_xml_processing_list":
                                slicesPSProcessingList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "create_slices_ps_thumbnail_path_list":
                                slicesThumbnailList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                        }
                    }
                    #endregion

                    #region Step 0: Create Study
                    string studyUID = string.Empty;
                    StudyService stusrv = new StudyService();
                    XMLResult stuRsl = stusrv.createStudy(studyPara);
                    if (stuRsl.IsErrorOccured)
                    {
                        continue;
                    }
                    else
                    {
                        studyUID = stuRsl.SingleResult;
                    }

                    #endregion

                    #region Step 1: Create Volume
                    CheckPoint cpCreateVolume = new CheckPoint("Create Volume Info", "Call createVolume");
                    r.CheckPoints.Add(cpCreateVolume);
                    XMLParameterCollection cInputData = new XMLParameterCollection();


                    cInputData.Add(cSeriesData);
                    cInputData.Add(cVolumeData);
                    cInputData.Add(cSlicePathData);
                    VolumeService volumesrv = new VolumeService();
                    XMLResult rslCreate = volumesrv.createVolume(studyUID, cInputData);
                    if (rslCreate.IsErrorOccured)
                    {
                        cpCreateVolume.Result = TestResult.Fail;
                        cpCreateVolume.Outputs.AddParameter("Create Volume Info", "Call createVolume", rslCreate.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        cpCreateVolume.Result = TestResult.Pass;
                        cpCreateVolume.Outputs.AddParameter("Create Volume Info", "Call createVolume", rslCreate.ResultContent);
                        volumeID = rslCreate.SingleResult;
                    }
                    #endregion

                    #region Step 2: Create Analysis3D
                    CheckPoint cpCreateA3d = new CheckPoint("Create Analysis3D", "Call createAnalysis3D");
                    r.CheckPoints.Add(cpCreateA3d);
                    Analysis3DService a3dsrv = new Analysis3DService();
                    XMLParameter a3dpara = new XMLParameter("analysis3d");
                    a3dpara.AddParameter("analysis3D_xml", "analysis3D_xml");
                    XMLResult a3dcreateRsl = a3dsrv.createAnalysis3D(volumeID, a3dpara);
                    string a3duid = "";
                    if (a3dcreateRsl.IsErrorOccured)
                    {
                        cpCreateA3d.Result = TestResult.Fail;
                        cpCreateA3d.Outputs.AddParameter("Create Analysis3D", "Call createAnalysis3D", a3dcreateRsl.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        cpCreateA3d.Result = TestResult.Pass;
                        cpCreateA3d.Outputs.AddParameter("Create Analysis3D", "Call createAnalysis3D", a3dcreateRsl.ResultContent);
                        a3duid = a3dcreateRsl.SingleResult;
                    }

                    #endregion

                    #region Step 3: Create Cross Section
                    CheckPoint cpCreateCSS = new CheckPoint("Create Analysis3D", "Call createAnalysis3D");
                    r.CheckPoints.Add(cpCreateCSS);


                    XMLParameterCollection p_createCrossSection = new XMLParameterCollection();
                    p_createCrossSection.Add(crosssection);
                    p_createCrossSection.Add(slicesPathList);
                    p_createCrossSection.Add(slicesPSAnnotationList);
                    p_createCrossSection.Add(slicesPSGeneralList);
                    p_createCrossSection.Add(slicesPSProcessingList);
                    p_createCrossSection.Add(slicesThumbnailList);

                    CrossSectionService crossSectionSvc = new CrossSectionService();
                    XMLResult rt_Create = crossSectionSvc.createCrossSection(volumeID, p_createCrossSection);

                    if (rt_Create.IsErrorOccured)
                    {
                        cpCreateCSS.Result = TestResult.Fail;
                        cpCreateCSS.Outputs.AddParameter("Create", "Create a new crosssection returns error", rt_Create.Message);

                        SaveRound(r);
                        break; // There is error, end test case
                    }
                    else
                    {
                        cpCreateCSS.Outputs.AddParameter("Create", "Create a new crosssection returns succeess", rt_Create.Message);

                        //Check the "internal_id" in return is present
                        bool isInternalIDCorrect = true;

                        if (rt_Create.SingleResult == null || rt_Create.SingleResult == String.Empty)
                        {
                            isInternalIDCorrect = false;
                        }

                        if (!isInternalIDCorrect)
                        {
                            cpCreateCSS.Result = TestResult.Fail;
                            cpCreateCSS.Outputs.AddParameter("Create", "Create a new crosssection returns wrong internal_id: ", rt_Create.Message);

                            SaveRound(r);
                            break; // There is error, end test case
                        }
                        else
                        {
                            cpCreateCSS.Result = TestResult.Pass;
                            cpCreateCSS.Outputs.AddParameter("Create", "Create a new crosssection returns correct internal_id: ", rt_Create.SingleResult);

                            string crosssectionuid = rt_Create.SingleResult;

                            CheckPoint cplinkcstoa3d = new CheckPoint("link CrossSection To Analysis3D", "Call linkCrossSectionToAnalysis3D");
                            r.CheckPoints.Add(cplinkcstoa3d);

                            //link cs to a3d
                            XMLResult linkRsl = a3dsrv.linkCrossSectionToAnalysis3D(a3duid, crosssectionuid);
                            if (linkRsl.IsErrorOccured)
                            {
                                cplinkcstoa3d.Result = TestResult.Fail;
                                cplinkcstoa3d.Outputs.AddParameter("Link Fail", "Link Cross Section to Analysis3D", "Return ERROR");
                            }
                            else
                            {
                                XMLResult getcsuidfroma3d = a3dsrv.listCrossSectionsOfAnalysis3D(a3duid);
                                if (!getcsuidfroma3d.IsErrorOccured)
                                {
                                    if (crosssectionuid == getcsuidfroma3d.SingleResult)
                                    {
                                        cplinkcstoa3d.Result = TestResult.Pass;
                                        cplinkcstoa3d.Outputs.AddParameter("Link Success", "Link Cross Section to Analysis3D", "Return Cross Section is matched with link");
                                    }
                                }
                            }
                        }
                    }
                    #endregion

                    SaveRound(r);
                }
                catch (Exception ex)
                {
                    CheckPoint cp = new CheckPoint();
                    r.CheckPoints.Add(cp);
                    cp.Result = TestResult.Fail;
                    cp.Outputs.AddParameter("Exception thrown", "Exception Message", ex.Message);
                    SaveRound(r);
                }
            }

            Output();
        }
        public void Run_WorkFlow_3Dv_createA3D_Case1688()  //  //case 1.9.2_WorkFlow_3Dv_createA3D
        {
            int runCount = 0;

            foreach (InputDataSet ids in this.Input.DataSets)
            {
                runCount++;
                Round r = this.NewRound(runCount.ToString(), ids.Description);

                try
                {
                    #region Parameter initialize

                    string volumeID = "";
                    string criteriaOfAnalysis = "";
                    //for create volume
                    XMLParameter cSeriesData = new XMLParameter("series");
                    XMLParameter cVolumeData = new XMLParameter("volume");
                    XMLParameter cSlicePathData = new XMLParameter("slices_path_list");
                    //for create study
                    XMLParameter studyPara = new XMLParameter("request");
                    XMLParameter xmlAnalysisInfo = new XMLParameter("analysis3d");

                    for (int i = 0; i < ids.InputParameters.Count; i++)
                    {
                        switch (ids.InputParameters.GetParameter(i).Step)
                        {
                            case "series":
                                cSeriesData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "volume":
                                cVolumeData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "slices_path_list":
                                cSlicePathData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "study":
                                studyPara.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                        }

                        if (ids.InputParameters.GetParameter(i).Step == "Analyses3D")
                        {
                            if (ids.InputParameters.GetParameter(i).Key == "criteria")
                            {
                                criteriaOfAnalysis = ids.InputParameters.GetParameter(i).Value;
                            }
                        }
                    }
                    #endregion

                    #region Step 0: Create Study
                    string studyUID = string.Empty;
                    StudyService stusrv = new StudyService();
                    XMLResult stuRsl = stusrv.createStudy(studyPara);
                    if (stuRsl.IsErrorOccured)
                    {
                        continue;
                    }
                    else
                    {
                        studyUID = stuRsl.SingleResult;
                    }

                    #endregion

                    #region Step 1: Create Volume
                    CheckPoint cpCreateVolume = new CheckPoint("Create Volume Info", "Call createVolume");
                    r.CheckPoints.Add(cpCreateVolume);
                    XMLParameterCollection cInputData = new XMLParameterCollection();

                    cInputData.Add(cSeriesData);
                    cInputData.Add(cVolumeData);
                    cInputData.Add(cSlicePathData);
                    VolumeService volumesrv = new VolumeService();
                    XMLResult rslCreate = volumesrv.createVolume(studyUID, cInputData);
                    if (rslCreate.IsErrorOccured)
                    {
                        cpCreateVolume.Result = TestResult.Fail;
                        cpCreateVolume.Outputs.AddParameter("Create Volume Info", "Call createVolume", rslCreate.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        cpCreateVolume.Result = TestResult.Pass;
                        cpCreateVolume.Outputs.AddParameter("Create Volume Info", "Call createVolume", rslCreate.ResultContent);
                        volumeID = rslCreate.SingleResult;
                    }
                    #endregion

                    #region Step 2: Create Analysis3D
                    CheckPoint cpCreateA3d = new CheckPoint("Create Analysis3D", "Call createAnalysis3D");
                    r.CheckPoints.Add(cpCreateA3d);
                    Analysis3DService a3dsrv = new Analysis3DService();
                    XMLParameter a3dpara = new XMLParameter("analysis3d");
                    a3dpara.AddParameter("analysis3D_xml", "analysis3D_xml");
                    XMLResult a3dcreateRsl = a3dsrv.createAnalysis3D(volumeID, a3dpara);
                    string a3duid = "";
                    if (a3dcreateRsl.IsErrorOccured)
                    {
                        cpCreateA3d.Result = TestResult.Fail;
                        cpCreateA3d.Outputs.AddParameter("Create Analysis3D", "Call createAnalysis3D", a3dcreateRsl.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        cpCreateA3d.Result = TestResult.Pass;
                        cpCreateA3d.Outputs.AddParameter("Create Analysis3D", "Call createAnalysis3D", a3dcreateRsl.ResultContent);
                        a3duid = a3dcreateRsl.SingleResult;
                    }

                    #endregion

                    #region Step 3: listAnalyses3DOfVolume
                    CheckPoint cpGetA3dofVolume = new CheckPoint("Get Analysis3D from volume", "Call listAnalyses3DOfVolume");
                    r.CheckPoints.Add(cpGetA3dofVolume);

                    XMLResult geta3dfromvolume = volumesrv.listAnalyses3DOfVolume(volumeID, criteriaOfAnalysis);

                    if (geta3dfromvolume.IsErrorOccured)
                    {
                        cpGetA3dofVolume.Result = TestResult.Fail;
                        cpGetA3dofVolume.Outputs.AddParameter("Get Analysis3D from volume", "Call listAnalyses3DOfVolume", geta3dfromvolume.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        if (a3duid == geta3dfromvolume.SingleResult)
                        {
                            cpGetA3dofVolume.Result = TestResult.Pass;
                            cpGetA3dofVolume.Outputs.AddParameter("Get Analysis3D from volume", "Call listAnalyses3DOfVolume", geta3dfromvolume.ResultContent);
                        }
                    }

                    #endregion
                    SaveRound(r);
                }
                catch (Exception ex)
                {
                    CheckPoint cp = new CheckPoint();
                    r.CheckPoints.Add(cp);
                    cp.Result = TestResult.Fail;
                    cp.Outputs.AddParameter("Exception thrown", "Exception Message", ex.Message);
                    SaveRound(r);
                }
            }

            Output();
        }
        public void Run_WorkFlow_3Dv_createVolume_with_created_and_set_a3d_Case1660()  //  //case 1.9.1_WorkFlow_3Dv_createVolume_with_created_and_set_a3d
        {
            int runCount = 0;

            foreach (InputDataSet ids in this.Input.DataSets)
            {
                runCount++;
                Round r = this.NewRound(runCount.ToString(), ids.Description);

                try
                {
                    #region Parameter initialize

                    string volumeID = "";
                    //for create volume
                    XMLParameter cSeriesData = new XMLParameter("series");
                    XMLParameter cVolumeData = new XMLParameter("volume");
                    XMLParameter cSlicePathData = new XMLParameter("slices_path_list");
                    //for create study
                    XMLParameter studyPara = new XMLParameter("request");
                    XMLParameter xmlAnalysisInfo = new XMLParameter("analysis3d");

                    for (int i = 0; i < ids.InputParameters.Count; i++)
                    {
                        switch (ids.InputParameters.GetParameter(i).Step)
                        {
                            case "series":
                                cSeriesData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
                                break;
                            case "volume":
                                cVolumeData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
                                break;
                            case "slices_path_list":
                                cSlicePathData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
                                break;
                            case "study":
                                studyPara.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "seta3d":
                                xmlAnalysisInfo.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                        }
                    }
                    #endregion

                    #region Step 0: Create Study
                    string studyUID = string.Empty;
                    StudyService stusrv = new StudyService();
                    XMLResult stuRsl = stusrv.createStudy(studyPara);
                    if (stuRsl.IsErrorOccured)
                    {
                        continue;
                    }
                    else
                    {
                        studyUID = stuRsl.SingleResult;
                    }

                    #endregion

                    #region Step 1: Create Volume
                    CheckPoint cpCreateVolume = new CheckPoint("Create Volume Info", "Call createVolume");
                    r.CheckPoints.Add(cpCreateVolume);
                    XMLParameterCollection cInputData = new XMLParameterCollection();


                    cInputData.Add(cSeriesData);
                    cInputData.Add(cVolumeData);
                    cInputData.Add(cSlicePathData);
                    VolumeService volumesrv = new VolumeService();
                    XMLResult rslCreate = volumesrv.createVolume(studyUID, cInputData);
                    if (rslCreate.IsErrorOccured)
                    {
                        cpCreateVolume.Result = TestResult.Fail;
                        cpCreateVolume.Outputs.AddParameter("Create Volume Info", "Call createVolume", rslCreate.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        cpCreateVolume.Result = TestResult.Pass;
                        cpCreateVolume.Outputs.AddParameter("Create Volume Info", "Call createVolume", rslCreate.ResultContent);
                        volumeID = rslCreate.SingleResult;
                    }
                    #endregion

                    #region Step 2: Create Analysis3D
                    CheckPoint cpCreateA3d = new CheckPoint("Create Analysis3D", "Call createAnalysis3D");
                    r.CheckPoints.Add(cpCreateA3d);
                    Analysis3DService a3dsrv = new Analysis3DService();
                    XMLParameter a3dpara = new XMLParameter("analysis3d");
                    a3dpara.AddParameter("analysis3D_xml", "analysis3D_xml");
                    XMLResult a3dcreateRsl = a3dsrv.createAnalysis3D(volumeID, a3dpara);
                    string a3duid = "";
                    if (a3dcreateRsl.IsErrorOccured)
                    {
                        cpCreateA3d.Result = TestResult.Fail;
                        cpCreateA3d.Outputs.AddParameter("Create Analysis3D", "Call createAnalysis3D", a3dcreateRsl.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        cpCreateA3d.Result = TestResult.Pass;
                        cpCreateA3d.Outputs.AddParameter("Create Analysis3D", "Call createAnalysis3D", a3dcreateRsl.ResultContent);
                        a3duid = a3dcreateRsl.SingleResult;
                    }

                    #endregion

                    #region Step 3: Set Analysis3D
                    CheckPoint cpSetA3d = new CheckPoint("Set Analysis3D", "Call setAnalysis3DInfo");
                    r.CheckPoints.Add(cpSetA3d);
                    XMLResult seta3dRsl = a3dsrv.setAnalysis3DInfo(a3duid, xmlAnalysisInfo);
                    if (seta3dRsl.IsErrorOccured)
                    {
                        cpSetA3d.Result = TestResult.Fail;
                        cpSetA3d.Outputs.AddParameter("Set Analysis3D", "Call setAnalysis3DInfo", seta3dRsl.Message);
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        XMLResult geta3dRsl = a3dsrv.getAnalysis3DInfo(a3duid);

                        int matchCount = 0;

                        for (int j = 0; j < geta3dRsl.MultiResults[0].Length; j++)
                        {
                            if (geta3dRsl.MultiResults[0].Parameters[j].ParameterName == "name"
                                && geta3dRsl.MultiResults[0].Parameters[j].ParameterValue == "modified analysis 3d")
                            {
                                matchCount++;
                            }
                            if (geta3dRsl.MultiResults[0].Parameters[j].ParameterName == "comments"
                                && geta3dRsl.MultiResults[0].Parameters[j].ParameterValue == "set with some modification")
                            {
                                matchCount++;
                            }
                            if (geta3dRsl.MultiResults[0].Parameters[j].ParameterName == "current"
                                && geta3dRsl.MultiResults[0].Parameters[j].ParameterValue == "true")
                            {
                                matchCount++;
                            }
                            if (geta3dRsl.MultiResults[0].Parameters[j].ParameterName == "object_creation_date"
                                && geta3dRsl.MultiResults[0].Parameters[j].ParameterValue == "2012-12-05T15:25:00+08:00")
                            {
                                matchCount++;
                            }

                        }

                        if (matchCount == 4)
                        {
                            cpSetA3d.Result = TestResult.Pass;
                            cpSetA3d.Outputs.AddParameter("Set Analysis3D", "Call setAnalysis3DInfo", seta3dRsl.ResultContent);
                        }
                        else
                        {
                            cpSetA3d.Result = TestResult.Fail;
                            cpSetA3d.Outputs.AddParameter("Set Analysis3D", "Call setAnalysis3DInfo", "The set value is not equal with get");
                        }


                    }

                    #endregion

                    SaveRound(r);
                }
                catch (Exception ex)
                {
                    CheckPoint cp = new CheckPoint();
                    r.CheckPoints.Add(cp);
                    cp.Result = TestResult.Fail;
                    cp.Outputs.AddParameter("Exception thrown", "Exception Message", ex.Message);
                    SaveRound(r);
                }
            }

            Output();
        }