当前位置: 首页>>代码示例>>C#>>正文


C# XMLParameter.GetParameterValueByName方法代码示例

本文整理汇总了C#中PAS.AutoTest.PasATCore.XMLParameter.GetParameterValueByName方法的典型用法代码示例。如果您正苦于以下问题:C# XMLParameter.GetParameterValueByName方法的具体用法?C# XMLParameter.GetParameterValueByName怎么用?C# XMLParameter.GetParameterValueByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PAS.AutoTest.PasATCore.XMLParameter的用法示例。


在下文中一共展示了XMLParameter.GetParameterValueByName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run_PS_ImportDicom_RadioLog_Case1094

        //Case 1094: 1.3.7_WorkFlow_ImportDICOMImage+GetPresentationStateInfo_RadioLogInformation
        public void Run_PS_ImportDicom_RadioLog_Case1094()
        {
            //int runCount = this.Input.Repetition;

            int runCount = 0; // this is the initial run count. Use this count to repeat different test data set.

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

                //Mark the check point here to indicate what's the check point here
                CheckPoint p1 = new CheckPoint("createPatient", "Setup environment of createPatient");
                CheckPoint p2 = new CheckPoint("importObject", "Setup environment of importObject");
                CheckPoint p3 = new CheckPoint("getImageInfo", "Test getImageInfo");
                CheckPoint p4 = new CheckPoint("getPresentationStateInfo", "Test getPresentationStateInfo");

                r.CheckPoints.Add(p1);
                r.CheckPoints.Add(p2);
                r.CheckPoints.Add(p3);
                r.CheckPoints.Add(p4);

                //create required PAS service instaces here
                PatientService pats = new PatientService();
                ImportService ims = new ImportService();
                ImageService img = new ImageService();
                PresentationStateService ps = new PresentationStateService();

                //create input parameters here, it may include XML path type and string type value
                XMLParameter pa1 = new XMLParameter("patient");
                XMLParameter pa2 = new XMLParameter("importObject");
                XMLParameter pa3 = new XMLParameter("image");
                XMLParameter ps4 = new XMLParameter("presentationstate");
                XMLParameterCollection pa4 = new XMLParameterCollection();

                try
                {
                    for (int i = 0; i < ids.InputParameters.Count; i++)
                    {
                        switch (ids.InputParameters.GetParameter(i).Step)
                        {
                            case "createPatient":
                                pa1.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "importObject":
                                pa2.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            default:
                                Console.WriteLine("There is no valid selection when parse input parameters.");
                                break;
                        }
                    }

                    //If we need change parameter by specific logic, please put code here

                    //Get service result
                    //Step1 result

                    XMLResult step1_result = pats.createPatient(pa1);

                    //Log step1 service output
                    if (step1_result.IsErrorOccured)
                    {
                        p1.Result = TestResult.Fail;
                        p1.Outputs.AddParameter("Step 1: createPatient", "Error", step1_result.ResultContent);
                        SaveRound(r);
                        continue;
                    }

                    p1.Result = TestResult.Pass;
                    p1.Outputs.AddParameter("Step 1: createPatient", "Success", step1_result.ResultContent);

                    //Change input parameter according the output of Step1
                    pa2.AddParameter("patientInternalId", step1_result.SingleResult);

                    //Step2 result

                    //if objectFileFullPath is empty string, skip step2
                    if (pa2.GetParameterValueByName("objectFileFullPath") != null && pa2.GetParameterValueByName("objectFileFullPath") != "")
                    {
                        XMLResult step2_result = ims.importObject(pa2.GetParameterValueByName("patientInternalId"), "", pa2.GetParameterValueByName("objectFileFullPath"), "", false, "");

                        //Log step2 service output
                        if (step2_result.IsErrorOccured)
                        {
                            p2.Result = TestResult.Fail;
                            p2.Outputs.AddParameter("Step 2: importObject", "Error", step2_result.ResultContent);
                            SaveRound(r);
                            continue;
                        }

                        p2.Result = TestResult.Pass;
                        p2.Outputs.AddParameter("Step 2: importObject", "Success", step2_result.ResultContent);

                        //Change input parameter according the output of Step2
                        // if step2 is skipped, step3 input has no need parameter of internal_id

                        for (int i = 0; i < step2_result.MultiResults.Count; i++)
                        {
//.........这里部分代码省略.........
开发者ID:Manivannan-ezhumalai,项目名称:AutomationTestFramework,代码行数:101,代码来源:PresentationState.cs

示例2: Run_RadioLogicalLog_WorkFlow_N02_CreateDeleteGet_Case926

        //Case 926: 1.3.3_WorkFlow_N02_CreateDeleteGet
        public void Run_RadioLogicalLog_WorkFlow_N02_CreateDeleteGet_Case926()
        {
            //int runCount = this.Input.Repetition;

            int runCount = 0; // this is the initial run count. Use this count to repeat different test data set.

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

                //Mark the check point here to indicate what's the check point here
                CheckPoint p1 = new CheckPoint("createPatient", "Setup environment of createPatient");
                CheckPoint p2 = new CheckPoint("createRadioLogEntry", "Setup environment of createRadioLogEntry");
                CheckPoint p3 = new CheckPoint("deleteRadioLogEntry", "Test deleteRadioLogEntry");
                CheckPoint p4 = new CheckPoint("getRadioLogEntry", "Test getRadioLogEntry");

                r.CheckPoints.Add(p1);
                r.CheckPoints.Add(p2);
                r.CheckPoints.Add(p3);
                r.CheckPoints.Add(p4);

                //create required PAS service instaces here
                PatientService pats = new PatientService();
                RadiologService radios = new RadiologService();

                //create input parameters here, it may include XML path type and string type value
                XMLParameter pa1 = new XMLParameter("createPatient");
                XMLParameter pa2 = new XMLParameter("createRadioLogEntry");
                XMLParameter pa3 = new XMLParameter("deleteRadioLogEntry");
                XMLParameter pa4 = new XMLParameter("getRadioLogEntry");

                for (int i = 0; i < ids.InputParameters.Count; i++)
                {
                    switch (ids.InputParameters.GetParameter(i).Step)
                    {
                        case "createPatient":
                            pa1.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        case "createRadioLogEntry":
                            pa2.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        case "deleteRadioLogEntry":
                            pa3.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        case "getRadioLogEntry":
                            pa4.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        default:
                            Console.WriteLine("There is no valid selection when parse input parameters.");
                            break;
                    }
                }

                //If we need change parameter by specific logic, please put code here

                //Get service result
                //Step1 result

                XMLResult step1_result = pats.createPatient(pa1);

                //Log step1 service output
                if (step1_result.IsErrorOccured)
                {
                    p1.Result = TestResult.Fail;
                    p1.Outputs.AddParameter("createPatient", "Error", step1_result.ResultContent);
                    SaveRound(r);
                    continue;
                }

                p1.Result = TestResult.Pass;
                p1.Outputs.AddParameter("createPatient", "Success", step1_result.ResultContent);

                //Change input parameter according the output of Step1
                pa2.AddParameter("patient_internal_id", step1_result.SingleResult);

                //Step2 result

                XMLResult step2_result = radios.createRadioLogEntry(pa2);

                //Log step2 service output
                if (step2_result.IsErrorOccured)
                {
                    p2.Result = TestResult.Fail;
                    p2.Outputs.AddParameter("createRadioLogEntry", "Error", step2_result.ResultContent);
                    SaveRound(r);
                    continue;
                }

                p2.Result = TestResult.Pass;
                p2.Outputs.AddParameter("createRadioLogEntry", "Success", step2_result.ResultContent);

                //Change input parameter according the output of Step2
                pa3.AddParameter("radioLogEntryInternalId", step2_result.SingleResult);
                pa4.AddParameter("radioLogEntryInternalId", step2_result.SingleResult);

                //Step3 result

                XMLResult step3_result = radios.deleteRadioLogEntry(pa3.GetParameterValueByName("radioLogEntryInternalId"));
//.........这里部分代码省略.........
开发者ID:Manivannan-ezhumalai,项目名称:AutomationTestFramework,代码行数:101,代码来源:RadioLogicalLog.cs

示例3: Run_PS_Acq_Radiolog_Case1091

        //Case 1091: 1.3.7_WorkFlow_AcquireRVG+SetImageInfo+GetPresentationStateInfo_RadioLogInformation
        public void Run_PS_Acq_Radiolog_Case1091()
        {
            //int runCount = this.Input.Repetition;

            int runCount = 0; // this is the initial run count. Use this count to repeat different test data set.

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

                //Mark the check point here to indicate what's the check point here
                CheckPoint p1 = new CheckPoint("createPatient", "Setup environment of createPatient");
                CheckPoint p2 = new CheckPoint("startAcquisition", "Setup environment of acquisition");
                CheckPoint p3 = new CheckPoint("getAcquisitionResult", "Setup environment of image and PS id");
                CheckPoint p4 = new CheckPoint("setImageInfo", "Setup environment of setImageInfo");
                CheckPoint p5 = new CheckPoint("getImageInfo", "Test getImageInfo");
                CheckPoint p6 = new CheckPoint("getPresentationStateInfo", "Test getPresentationStateInfo");

                r.CheckPoints.Add(p1);
                r.CheckPoints.Add(p2);
                r.CheckPoints.Add(p3);
                r.CheckPoints.Add(p4);
                r.CheckPoints.Add(p5);
                r.CheckPoints.Add(p6);

                //create required PAS service instaces here
                PatientService pats = new PatientService();
                AcquisitionService acq = new AcquisitionService();
                ImageService img = new ImageService();
                PresentationStateService ps = new PresentationStateService();

                //create input parameters here, it may include XML path type and string type value
                XMLParameter pa1 = new XMLParameter("patient");
                XMLParameter pa2 = new XMLParameter("acq_info");
                XMLParameter pa3 = new XMLParameter("getAcquisitionResult");
                XMLParameter pa4 = new XMLParameter("image");
                XMLParameter pa5 = new XMLParameter("image");
                XMLParameter pt6 = new XMLParameter("presentationstate");
                XMLParameterCollection pa6 = new XMLParameterCollection();

                try
                {

                    for (int i = 0; i < ids.InputParameters.Count; i++)
                    {
                        switch (ids.InputParameters.GetParameter(i).Step)
                        {
                            case "createPatient":
                                pa1.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "acquire":
                                pa2.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            case "setImageInfo":
                                pa4.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                                break;
                            default:
                                Console.WriteLine("There is no valid selection when parse input parameters.");
                                break;
                        }
                    }

                    //If we need change parameter by specific logic, please put code here

                    //Get service result
                    //Step1 result

                    XMLResult step1_result = pats.createPatient(pa1);

                    //Log step1 service output
                    if (step1_result.IsErrorOccured)
                    {
                        p1.Result = TestResult.Fail;
                        p1.Outputs.AddParameter("createPatient", "Error", step1_result.ResultContent);
                        SaveRound(r);
                        continue;
                    }

                    p1.Result = TestResult.Pass;
                    p1.Outputs.AddParameter("createPatient", "Success", step1_result.ResultContent);

                    //Change input parameter according the output of Step1
                    pa2.AddParameter("patient_internal_id", step1_result.SingleResult);

                    //Step2 result

                    //if acquireType isn't emtpy string, skip step2, here is only RVG acquisition
                    bool acqflag = true;
                    XMLResult step3_result = new XMLResult();
                    if (pa2.GetParameterValueByName("acquireType") == null || pa2.GetParameterValueByName("acquireType") == "")
                    {
                        XMLResult rslAcqRVG = acq.startAcquisition(pa2);
                        System.Threading.Thread.Sleep(3000);
                        if (rslAcqRVG.IsErrorOccured)
                        {
                            System.Diagnostics.Debug.Print("Acquire fail:");
                            p2.Result = TestResult.Fail;
                            p2.Outputs.AddParameter("acquire", "Acquire image error", rslAcqRVG.Message);
//.........这里部分代码省略.........
开发者ID:Manivannan-ezhumalai,项目名称:AutomationTestFramework,代码行数:101,代码来源:PresentationState.cs

示例4: Run_RadioLogicalLog_WorkFlow_N01_CreateGet_Case925

        //Case 925: 1.3.3_WorkFlow_N01_CreateGet
        public void Run_RadioLogicalLog_WorkFlow_N01_CreateGet_Case925()
        {
            //int runCount = this.Input.Repetition;

            int runCount = 0; // this is the initial run count. Use this count to repeat different test data set.

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

                //Mark the check point here to indicate what's the check point here
                CheckPoint p1 = new CheckPoint("createPatient", "Setup environment of createPatient");
                CheckPoint p2 = new CheckPoint("importObject", "Setup environment of importObject");
                CheckPoint p3 = new CheckPoint("createRadioLogEntry", "Test createRadioLogEntry");
                CheckPoint p4 = new CheckPoint("getRadioLogEntry", "Test getRadioLogEntry");

                r.CheckPoints.Add(p1);
                r.CheckPoints.Add(p2);
                r.CheckPoints.Add(p3);
                r.CheckPoints.Add(p4);

                //create required PAS service instaces here
                PatientService pats = new PatientService();
                ImportService ims = new ImportService();
                RadiologService radios = new RadiologService();

                //create input parameters here, it may include XML path type and string type value
                XMLParameter pa1 = new XMLParameter("createPatient");
                XMLParameter pa2 = new XMLParameter("importObject");
                XMLParameter pa3 = new XMLParameter("createRadioLogEntry");
                XMLParameter pa4 = new XMLParameter("getRadioLogEntry");

                for (int i = 0; i < ids.InputParameters.Count; i++)
                {
                    switch (ids.InputParameters.GetParameter(i).Step)
                    {
                        case "createPatient":
                            pa1.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        case "importObject":
                            pa2.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        case "createRadioLogEntry":
                            pa3.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        case "getRadioLogEntry":
                            pa4.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                            break;
                        default:
                            Console.WriteLine("There is no valid selection when parse input parameters.");
                            break;
                    }
                }

                //If we need change parameter by specific logic, please put code here

                //Get service result
                //Step1 result

                XMLResult step1_result = pats.createPatient(pa1);

                //Log step1 service output
                if (step1_result.IsErrorOccured)
                {
                    p1.Result = TestResult.Fail;
                    p1.Outputs.AddParameter("createPatient", "Error", step1_result.ResultContent);
                    SaveRound(r);
                    continue;
                }

                p1.Result = TestResult.Pass;
                p1.Outputs.AddParameter("createPatient", "Success", step1_result.ResultContent);

                //Change input parameter according the output of Step1
                pa2.AddParameter("patientInternalId", step1_result.SingleResult);
                pa3.AddParameter("patient_internal_id", step1_result.SingleResult);

                //Step2 result

                //if objectFileFullPath is empty string, skip step2
                if (pa2.GetParameterValueByName("objectFileFullPath") != null && pa2.GetParameterValueByName("objectFileFullPath") != "")
                {
                    XMLResult step2_result = ims.importObject(pa2.GetParameterValueByName("patientInternalId"), "", pa2.GetParameterValueByName("objectFileFullPath"), "", false, "");

                    //Log step2 service output
                    if (step2_result.IsErrorOccured)
                    {
                        p2.Result = TestResult.Fail;
                        p2.Outputs.AddParameter("importObject", "Error", step2_result.ResultContent);
                        SaveRound(r);
                        continue;
                    }

                    p2.Result = TestResult.Pass;
                    p2.Outputs.AddParameter("importObject", "Success", step2_result.ResultContent);

                    //Change input parameter according the output of Step2
                    // if step2 is skipped, step3 input has no need parameter of instance_internal_id
//.........这里部分代码省略.........
开发者ID:Manivannan-ezhumalai,项目名称:AutomationTestFramework,代码行数:101,代码来源:RadioLogicalLog.cs


注:本文中的PAS.AutoTest.PasATCore.XMLParameter.GetParameterValueByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。