本文整理汇总了C#中PAS.AutoTest.TestData.CheckPoint类的典型用法代码示例。如果您正苦于以下问题:C# CheckPoint类的具体用法?C# CheckPoint怎么用?C# CheckPoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CheckPoint类属于PAS.AutoTest.TestData命名空间,在下文中一共展示了CheckPoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run_Version_GetVersion_Case1567
public void Run_Version_GetVersion_Case1567()
{
Round r = this.NewRound("Round 1", "GetVersion-Interface");
CheckPoint pLo = new CheckPoint("GetVersion-Interface", "Version service");
r.CheckPoints.Add(pLo);
try
{
int a = Utility.TestInterface();
if (a == 1)
{
pLo.Result = TestResult.Pass;
pLo.Outputs.AddParameter("GetVersion-Interface", "Version service", "Interface test pass");
}
else
{
pLo.Result = TestResult.Fail;
pLo.Outputs.AddParameter("GetVersion-Interface", "Version service", "Interface test fail");
}
}
catch
{
pLo.Result = TestResult.Fail;
pLo.Outputs.AddParameter("GetVersion-Interface", "Version service", "Interface test fail");
}
SaveRound(r);
Output();
}
示例2: Run_Patient_CreatePatient_Exception_Case62
//Case 62: 1.3.1_CreatePatient_Exception
public void Run_Patient_CreatePatient_Exception_Case62()
{
int runCount = 0;
foreach (InputDataSet ids in this.Input.DataSets)
{
runCount++;
Round r = this.NewRound(runCount.ToString(), "Create patient");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test description");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
XMLParameter pa = new XMLParameter("patient");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
XMLResult result = ps.createPatient(pa);
if (result.IsErrorOccured)
{
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("That's ok to create patient error:", "Create Patient", result.Message);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Expect create patient error, but it is succusss", "Create Patient", result.Message);
}
SaveRound(r);
}
Output();
}
示例3: Run_Analysis_Acq_CreateAnalysis_Normal_Case47
//Case 47: 1.3.12_CreateAnalysis_Normal
public void Run_Analysis_Acq_CreateAnalysis_Normal_Case47()
{
int runCount = 0;
string analysisContent = "<trophy type=\"analysis\" version=\"1.0\"> <trophyheader> <accesslog> <creation date=\"2011-10-25\" time=\"10:54:17\" applicationname=\"kdis2dviewer\" applicationversion=\"7.0\" /> <modification date=\"2011/10/25\" time=\"10:54:18\" applicationname=\"kdis2dviewer\" applicationversion=\"7.0\" /> </accesslog> </trophyheader> <templateheader> <object subtype=\"analysis\" instance=\"true\" name=\"Test Analysis\" uid=\"\" /> <comments /> <icon filepath=\"analysisicon.jpg\" /> <icon> <ObjectData>base64imagedata</ObjectData> </icon> <icon id=\"thumbnailid\" /> <AnalysisProp name=\"1112222\" comments=\"\" date=\"2011-10-25\" time=\"10:54:17\" arrangementmode=\"0\" /> </templateheader> <page index=\"0\" Dx=\"1280\" Dy=\"1024\" backgroundColour=\"RGB(0,0,0)\"> <Frame index=\"1\" type=\"floating panel\" x=\"938\" y=\"201\" w=\"200\" h=\"239\" Zorder=\"\"> <PanelProp paneltype=\"control panel xray\" id=\"control panel xray\" showstate=\"maximized\" /> </Frame> <Frame index=\"2\" type=\"floating panel\" x=\"938\" y=\"201\" w=\"200\" h=\"240\" Zorder=\"\"> <PanelProp paneltype=\"control panel color\" id=\"control panel color\" showstate=\"maximized\" /> </Frame> <Frame index=\"3\" type=\"image\" x=\"349\" y=\"299\" w=\"266\" h=\"355\" Zorder=\"\"> <PanelProp paneltype=\"image\" id=\"@@PSID0\" showstate=\"selected\" IdV0=\"76b3ec9d-1374-4a13-9950-6cf3f5ebc1e6\" /> </Frame> <Frame index=\"4\" type=\"image\" x=\"818\" y=\"299\" w=\"266\" h=\"354\" Zorder=\"\"> <PanelProp paneltype=\"image\" id=\"@@PSID1\" showstate=\"deselected\" IdV0=\"eb87d761-accf-4531-b4fc-9ee9861f15fd\" /> </Frame> </page></trophy>";
foreach (InputDataSet ids in this.Input.DataSets)
{
Round r = this.NewRound(runCount.ToString(), "Acquisition for Analysis");
CheckPoint pAnalysis = new CheckPoint("Create Analysis", "Create Analysis");
r.CheckPoints.Add(pAnalysis);
XMLParameter acq = new XMLParameter("acq_info");
string PatientID = string.Empty;
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "acquire")
{
if (ids.InputParameters.GetParameter(i).Key == "patient_internal_id")
PatientID = ids.InputParameters.GetParameter(i).Value;
acq.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
string retPsID = string.Empty;
string repStr = "@@PSID";
XMLParameterCollection anaUidsXML = new XMLParameterCollection();
XMLParameter anaUids = new XMLParameter("presentationstate");
for (int acqTime = 0; acqTime < 2; acqTime++)
{
retPsID = AcquisitionService.AcquireImage(acq);
if (retPsID != string.Empty)
{
analysisContent = analysisContent.Replace(repStr + acqTime, retPsID);
anaUids.AddParameter("internal_id", retPsID);
}
}
anaUidsXML.Add(anaUids);
AnalysisService ass = new AnalysisService();
XMLResult rslCreateAnalysis = ass.createAnalysis(analysisContent, false, true, PatientID, @"D:\Test\DICOM_Imag_Lib\ImportImage\thumb.PNG", anaUidsXML);
if (rslCreateAnalysis.IsErrorOccured)
{
pAnalysis.Result = TestResult.Fail;
pAnalysis.Outputs.AddParameter("Create Analysis", "Analysis Service", rslCreateAnalysis.Message);
}
else
{
pAnalysis.Result = TestResult.Pass;
pAnalysis.Outputs.AddParameter("Create Analysis ID:", "Analysis Service", rslCreateAnalysis.SingleResult);
}
ass.deleteAnalysis(rslCreateAnalysis.SingleResult);
SaveRound(r);
}
Output();
}
示例4: Run_Patient_CreatePatient_Normal_Case139
//Case 139: 1.2.1_CreatePatient_Normal
public void Run_Patient_CreatePatient_Normal_Case139()
{
int runCount = 0;
foreach (InputDataSet ids in this.Input.DataSets)
{
runCount++;
Round r = this.NewRound(runCount.ToString(), "Create patient");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test description");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
XMLParameter pa = new XMLParameter("patient");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
XMLResult result = ps.createPatient(pa);
if (result.IsErrorOccured)
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create error:", "Create Patient", result.Message);
}
else
{
pCreate.Outputs.AddParameter("Patient ID:", "Create Patient", result.SingleResult);
XMLResult getPatient = ps.getPatient(result.SingleResult);
if (getPatient.IsErrorOccured)
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Get created patient fail", "Get Patient", getPatient.ResultContent);
}
else
{
pCreate.Outputs.AddParameter("Get created patient OK", "Get Patient", getPatient.ResultContent);
XMLResult delPatient = ps.deletePatient(result.SingleResult);
if (delPatient.IsErrorOccured)
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Delete created patient fail", "Delete Patient", delPatient.ResultContent);
}
else
{
pCreate.Outputs.AddParameter("Delete created patient OK", "Delete Patient", delPatient.ResultContent);
pCreate.Result = TestResult.Pass;
}
}
}
SaveRound(r);
}
Output();
}
示例5: button3_Click
private void button3_Click(object sender, EventArgs e)
{
OutputData output = new OutputData("Test Test case name", "221");
Round r1 = new Round("R1", "test des for 1");
CheckPoint cp = new CheckPoint("cp1", "des for cp1");
cp.Inputs.AddParameter("input para1", "v1");
cp.Inputs.AddParameter("input para2", "v2");
cp.Inputs.AddParameter("input para3", "v3");
cp.Inputs.AddParameter("input para4", "v4");
cp.Outpus.AddParameter("output1", "v5");
cp.Outpus.AddParameter("output2", "v6");
cp.Outpus.AddParameter("output3", "v7");
cp.ExpectedValues.AddParameter("E1", "v8");
cp.ExpectedValues.AddParameter("E2", "v9");
cp.ExpectedValues.AddParameter("E3", "v10");
cp.Result = TestResult.Pass;
r1.CheckPoints.Add(cp);
CheckPoint cp2 = new CheckPoint("cp1", "des for cp1");
cp2.Inputs.AddParameter("input para1", "v1");
cp2.Inputs.AddParameter("input para2", "v2");
cp2.Inputs.AddParameter("input para3", "v3");
cp2.Inputs.AddParameter("input para4", "v4");
cp2.Outpus.AddParameter("output1", "v5");
cp2.Outpus.AddParameter("output2", "v6");
cp2.Outpus.AddParameter("output3", "v7");
cp2.ExpectedValues.AddParameter("E1", "v8");
cp2.ExpectedValues.AddParameter("E2", "v9");
cp2.ExpectedValues.AddParameter("E3", "v10");
cp2.Result = TestResult.Fail;
r1.CheckPoints.Add(cp);
output.Rounds.Add(r1);
output.ConvertToXml("C:/tss.xml");
}
示例6: Run
public void Run()
{
Round r = this.NewRound("R1","Test round");
CheckPoint p = new CheckPoint("Create Patient", "Test description");
r.CheckPoints.Add(p);
PatientService ps = new PatientService();
XMLParameter pa = new XMLParameter("patient");
pa.AddParameter(r.DataSet.InputParameters.GetParameter("dafsd").Value, "pid888");
pa.AddParameter("dpmsid", "dpmsid888");
pa.AddParameter("firstname", "Test");
pa.AddParameter("lastname", "Test");
pa.AddParameter("sex", "male");
XMLResult result= ps.createPatient(pa);
if (result.IsErrorOccured)
{
p.Result = TestResult.Fail;
p.Outputs.AddParameter("Error", result.Message);
}
else
{
p.Result = TestResult.Pass;
p.Outputs.AddParameter("New patient Id", result.SingleResult);
}
SaveRound(r);
Output();
System.Windows.Forms.MessageBox.Show("Done");
}
示例7: Run_Patient_SetPatient_Normal_Case34
//Case 34: 1.3.1_SetPatient_Normal
public void Run_Patient_SetPatient_Normal_Case34()
{
int runCount = 0;
int matchItem = 1;
string patientUID = string.Empty;
bool isCreatePatient = false;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "set patient");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
XMLParameter cpatientData = new XMLParameter("patient");
XMLParameter spatientData = new XMLParameter("patient");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
cpatientData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "set")
{
spatientData.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
matchItem++;
}
}
if (isCreatePatient)
{
XMLResult rslCreate = ps.createPatient(cpatientData);
if (!rslCreate.IsErrorOccured)
{
patientUID = rslCreate.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
//System.Diagnostics.Debug.Print("PAS: Create patient UID:{0}",patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("create", "Create patient ERR", rslCreate.Message);
//System.Diagnostics.Debug.Print("PAS: Create patient ERR:{0}",rslCreate.Message);
}
}
CheckPoint pSet = new CheckPoint("Set Patient", "Test set");
r.CheckPoints.Add(pSet);
XMLResult rslSet = ps.setPatient(spatientData, patientUID);
System.Threading.Thread.Sleep(500);
XMLResult rslGet = ps.getPatient(patientUID);
if (rslSet.IsErrorOccured || rslGet.IsErrorOccured)
{
pSet.Result = TestResult.Fail;
pSet.Outputs.AddParameter("set", "Set patient ERR", patientUID);
}
for (int j = 0; j < rslGet.ArrayResult.Length; j++)
{
for (int k = 0; k < spatientData.Length; k++)
{
if (rslGet.ArrayResult.GetParameterName(j) == spatientData.GetParameterName(k)
&& rslGet.ArrayResult.GetParameterValue(j) == spatientData.GetParameterValue(k))
matchItem--;
}
}
//System.Diagnostics.Debug.Print("PAS: Get patient match:{0}",matchItem - 1);
if (matchItem == 1)
{
pSet.Outputs.AddParameter("set", "Set patient OK", patientUID);
}
else
{
pSet.Result = TestResult.Fail;
pSet.Outputs.AddParameter("set", "Set patient ERR", rslSet.Message);
}
XMLResult delPat = ps.deletePatient(patientUID);
if (!delPat.IsErrorOccured)
{
pSet.Outputs.AddParameter("Delete created patient OK", "Delete Patient", delPat.Message);
pSet.Result = TestResult.Pass;
}
SaveRound(r);
}
Output();
}
示例8: Run_Patient_QueryPatient_Case1654
// Case 1654: 1.3.1_QueryPatients_N6_grouped by keyword in global search
public void Run_Patient_QueryPatient_Case1654()
{
int runCount = 0;
List<string> needDelete = new List<string>();
// step 1. create listed patients.
foreach (InputDataSet ids in this.Input.DataSets)
{
bool bSkip = false; // to skip query InputDataSet
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "queryPatient")
bSkip = true;
}
if (bSkip)
continue;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Create patient");
CheckPoint pCreate = new CheckPoint("Create Patient", "Test description");
r.CheckPoints.Add(pCreate);
PatientService ps = new PatientService();
XMLParameter pa = new XMLParameter("patient");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "createPatient")
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
XMLResult result = ps.createPatient(pa);
if (result.IsErrorOccured)
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create error:", "Create Patient", result.Message);
}
else
{
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Patient ID:", "Create Patient", result.SingleResult);
needDelete.Add(result.SingleResult);
}
SaveRound(r);
}
// step 2. query.
foreach (InputDataSet ids in this.Input.DataSets)
{
bool bSkip = false; // to skip create patient InputDataSet
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "createPatient")
bSkip = true;
}
if (bSkip)
continue;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Query patient");
CheckPoint pQuery = new CheckPoint("Query Patient", "Test description");
r.CheckPoints.Add(pQuery);
PatientService ps = new PatientService();
XMLParameter query = new XMLParameter("filter");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "queryPatient")
query.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
XMLResult queryPatient = ps.queryPatients(query); // should send global_search
if (queryPatient.IsErrorOccured)
{
pQuery.Result = TestResult.Fail;
pQuery.Outputs.AddParameter("Query created patient fail", "Query Patient", queryPatient.ResultContent);
}
else
{
pQuery.Outputs.AddParameter("Query created patient OK", "Query Patient", queryPatient.ResultContent);
// Here should add the checker for XMLResult
//
int iTotalExpectedResult = 0;
foreach (Parameter p in ids.ExpectedValues.Parameters)
{
int iStep = 0;
if (System.Int32.TryParse(p.Step, out iStep))
{
iTotalExpectedResult = iStep > iTotalExpectedResult ? iStep : iTotalExpectedResult;
}
}
System.Xml.XmlDocument xmlResult = new System.Xml.XmlDocument();
xmlResult.LoadXml(queryPatient.ResultContent);
int iNodelist = 0;
System.Xml.XmlNodeList patientList = xmlResult.SelectNodes("trophy/patient");
foreach (System.Xml.XmlNode patient in patientList)
{
if (iNodelist < iTotalExpectedResult)
{
// find the pAttr Key, should check whether the key attribute value is in expected result.
foreach (Parameter pExpected in ids.ExpectedValues.Parameters)
{
int iStep = 0;
//.........这里部分代码省略.........
示例9: Run_Patient_ListObjects_LogiconTagForImage_Case1643
// Case 1643: 1.1.03.12_List Objects - N10 - tag for image with logicon report
public void Run_Patient_ListObjects_LogiconTagForImage_Case1643()
{
int runCount = 0;
PatientService oldPatientSvc = new PatientService();
ImportService ims = new ImportService();
NewPatientService patientSvc = new NewPatientService();
PatientListObjectsRequestType pListObjects = new PatientListObjectsRequestType();
PatientListObjectsResponseType rtListObjects = new PatientListObjectsResponseType();
PatientListObjectsResponseType rtListObjectsAfterProcess = new PatientListObjectsResponseType();
foreach (InputDataSet ids in this.Input.DataSets)
{
runCount++;
Round r = this.NewRound(runCount.ToString(), ids.Description);
try
{
#region Initialize test data
XMLParameter pCreatePatient = new XMLParameter("patient");
string patientID = string.Empty;
string filePath = string.Empty;
string archivePath = string.Empty;
string imageID = string.Empty;
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "createPatient")
{
pCreatePatient.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
else if (ids.InputParameters.GetParameter(i).Step == "import")
{
if (ids.InputParameters.GetParameter(i).Key == "filePath")
{
filePath = ids.InputParameters.GetParameter(i).Value;
}
else if (ids.InputParameters.GetParameter(i).Key == "archivePath")
{
archivePath = ids.InputParameters.GetParameter(i).Value;
}
}
}
string tagBeforeProcess = null;
string tagAfterProcess = null;
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "listObjectsBeforeProcess")
{
tagBeforeProcess = ids.ExpectedValues.GetParameter(i).Value;
}
else if (ids.ExpectedValues.GetParameter(i).Step == "listObjectsAfterProcess")
{
tagAfterProcess = ids.ExpectedValues.GetParameter(i).Value;
}
}
#endregion
#region Step: Create a patient
CheckPoint cpCreate = new CheckPoint("Create Patient", "Create Patient");
r.CheckPoints.Add(cpCreate);
XMLResult rtCreatePatient = oldPatientSvc.createPatient(pCreatePatient);
if (rtCreatePatient.IsErrorOccured)
{
cpCreate.Result = TestResult.Fail;
cpCreate.Outputs.AddParameter("Create returns error:", "Create Patient", rtCreatePatient.Message);
SaveRound(r);
continue;
}
else
{
patientID = rtCreatePatient.SingleResult;
pListObjects.patientInternalId = patientID;
pListObjects.current = true;
pListObjects.currentSpecified = true;
cpCreate.Outputs.AddParameter("Patient ID:", "Create Patient", rtCreatePatient.SingleResult);
cpCreate.Result = TestResult.Pass;
}
#endregion
#region Step: Prepare a RVG image
CheckPoint cpImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(cpImport);
XMLResult rtlImport = ims.importObject(patientID, "", filePath, archivePath, false, "false");
if (rtlImport.IsErrorOccured)
{
cpImport.Result = TestResult.Fail;
cpImport.Outputs.AddParameter("import", "Import image fail", rtlImport.ResultContent);
}
else
{
cpImport.Result = TestResult.Pass;
cpImport.Outputs.AddParameter("import", "Import image OK", rtlImport.ResultContent);
imageID = rtlImport.SingleResult;
}
#endregion
//.........这里部分代码省略.........
示例10: Run_3D_ImportCSModel_GetVolumeInfo_Case1220
//Case 1220: 1.9.1_WorkFlow_N2_Import CS Model_GetVolumeInfo
public void Run_3D_ImportCSModel_GetVolumeInfo_Case1220()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
ImportService importSvc = new ImportService();
XMLParameter pCreatePatient = new XMLParameter("patient");
XMLParameter pImportImage = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pCreatePatient.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
pImportImage.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epGetVolumeInfo = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getVolumeInfo")
{
epGetVolumeInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
PatientService patientSvc = new PatientService();
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult result = patientSvc.createPatient(pCreatePatient);
if (!result.IsErrorOccured)
{
patientUID = result.SingleResult;
pCreate.Result = TestResult.Pass;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
}
else
{
pCreate.Result = TestResult.Fail;
pCreate.Outputs.AddParameter("Create patient returns error", "Create Patient", result.ResultContent);
}
}
CheckPoint cpImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(cpImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool overrideExisted = false;
for (int c = 0; c < pImportImage.Length; c++)
{
if (pImportImage.GetParameterName(c) == "path")
filePath = pImportImage.GetParameterValue(c);
if (pImportImage.GetParameterName(c) == "archivePath")
archivePath = pImportImage.GetParameterValue(c);
if (pImportImage.GetParameterName(c) == "move")
{
if (pImportImage.GetParameterValue(c) == "true")
overrideExisted = true;
}
}
XMLResult rtlImport = importSvc.importObject(patientUID, "", filePath, archivePath, overrideExisted, "false");
/**********************************************
import return sample:
- <trophy type="result" version="1.0">
<status code="0" message="ok" />
- <volume>
<parameter key="internal_id" value="5412d81a-c096-4b0d-ab93-524266af21b6" />
</volume>
</trophy>
* **********************************************/
if (rtlImport.IsErrorOccured)
{
cpImport.Result = TestResult.Fail;
cpImport.Outputs.AddParameter("Import volume fail", "Import", rtlImport.Message);
cpImport.Outputs.AddParameter("Import volume returns error code", "Import", rtlImport.Code.ToString());
}
else
{
//.........这里部分代码省略.........
示例11: Run_WorkFlow_ImportCeph_RadioLog_Case1043
//Case 1043: 1.3.17_workflow_ImportCeph_GetImageInfo_RadilogIsNotSaved
public void Run_WorkFlow_ImportCeph_RadioLog_Case1043()
{
int runCount = 0;
string patientUID = string.Empty;
bool isCreatePatient = false;
bool isDeletePatient = true;
foreach (InputDataSet ids in this.Input.DataSets)
{
isCreatePatient = false;
runCount++;
Round r = this.NewRound(runCount.ToString(), "Import image");
PatientService patientSvc = new PatientService();
ImportService importSvc = new ImportService();
ImageService imageSvc = new ImageService();
string radioLogBeforeImport = string.Empty;
string radioLogAfterImport = string.Empty;
string imageID = null;
XMLParameter pa = new XMLParameter("patient");
XMLParameter ia = new XMLParameter("import");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "create")
{
pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
isCreatePatient = true;
}
if (ids.InputParameters.GetParameter(i).Step == "import")
{
ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
XMLParameter epGetImagInfo = new XMLParameter();
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getImageInfo")
{
epGetImagInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
}
}
try
{
#region Step1: Create Image
if (isCreatePatient)
{
CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
r.CheckPoints.Add(pCreate);
XMLResult rtCreatePatient = patientSvc.createPatient(pa);
if (!rtCreatePatient.IsErrorOccured)
{
patientUID = rtCreatePatient.SingleResult;
pCreate.Outputs.AddParameter("Create patient UID", "Create Patient", patientUID);
pCreate.Result = TestResult.Pass;
}
}
#endregion
#region Step2: Get patient radio log info before import
CheckPoint cpGetPatientBeforeImport = new CheckPoint("GetPatient", "Get Patient Info before import image");
r.CheckPoints.Add(cpGetPatientBeforeImport);
XMLResult rtGetPatientBeforeImport = patientSvc.getPatient(patientUID);
if (rtGetPatientBeforeImport.IsErrorOccured)
{
cpGetPatientBeforeImport.Result = TestResult.Fail;
cpGetPatientBeforeImport.Outputs.AddParameter("Get Patient Info before import image returns error", "GetPatient", rtGetPatientBeforeImport.ResultContent);
}
else
{
cpGetPatientBeforeImport.Result = TestResult.Pass;
cpGetPatientBeforeImport.Outputs.AddParameter("Get Patient Info before import image returns ok", "GetPatient", rtGetPatientBeforeImport.ResultContent);
radioLogBeforeImport = rtGetPatientBeforeImport.MultiResults[0].GetParameterValueByName("cumulative_dose"); //get the cumulative_dose info
}
#endregion
#region Step3: Import Image
CheckPoint pImport = new CheckPoint("Import Image", "Test import");
r.CheckPoints.Add(pImport);
string filePath = string.Empty;
string archivePath = string.Empty;
bool move = false;
for (int c = 0; c < ia.Length; c++)
{
if (ia.GetParameterName(c) == "path")
{
filePath = ia.GetParameterValue(c);
}
else if (ia.GetParameterName(c) == "archivePath")
{
archivePath = ia.GetParameterValue(c);
}
else if (ia.GetParameterName(c) == "move")
//.........这里部分代码省略.........
示例12: 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++)
{
//.........这里部分代码省略.........
示例13: Run_PS_GetPresentationStateInfo_Exception_Case78
//Case 78: 1.3.7_GetPresentationStateInfo_Exception
public void Run_PS_GetPresentationStateInfo_Exception_Case78()
{
int runCount = 0;
foreach (InputDataSet ids in this.Input.DataSets)
{
runCount++;
Round r = this.NewRound(runCount.ToString(), "Test PresentationState Service: getPresentationStateInfo");
try
{
#region Parameter initialize
//Input parameters
XMLParameterCollection p_getPresentationStateInfo = new XMLParameterCollection();
XMLParameter p_PSID = new XMLParameter("presentationstate");
XMLParameter p_Preferences = new XMLParameter("preferences");
for (int i = 0; i < ids.InputParameters.Count; i++)
{
if (ids.InputParameters.GetParameter(i).Step == "getPresentationStateInfo")
{
if (ids.InputParameters.GetParameter(i).Key == "internal_id")
{
p_PSID.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
else if (ids.InputParameters.GetParameter(i).Key == "teeth_number_notation")
{
p_Preferences.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
}
}
}
p_getPresentationStateInfo.Add(p_PSID);
p_getPresentationStateInfo.Add(p_Preferences);
// Output value
bool ep_isReturnOK = true;
string ep_ReturnValue = string.Empty;
string ep_imageID = string.Empty;
XMLParameter ep_getPresentationStateInfo = new XMLParameter("presentationstate");
for (int i = 0; i < ids.ExpectedValues.Count; i++)
{
if (ids.ExpectedValues.GetParameter(i).Step == "getPresentationStateInfo")
{
switch (ids.ExpectedValues.GetParameter(i).Key)
{
case "returnState":
{
if (ids.ExpectedValues.GetParameter(i).Value.ToLower().Equals("pass"))
{
ep_isReturnOK = true;
}
else if (ids.ExpectedValues.GetParameter(i).Value.ToLower().Equals("fail"))
{
ep_isReturnOK = false;
}
break;
}
case "returnMessage":
{
ep_ReturnValue = ids.ExpectedValues.GetParameter(i).Value;
break;
}
default:
{
ep_getPresentationStateInfo.AddParameter(ids.ExpectedValues.GetParameter(i).Key, ids.ExpectedValues.GetParameter(i).Value);
break;
}
}
}
}
#endregion
PresentationStateService psService = new PresentationStateService();
#region Step 1: Call PresentationStateService.GetPresentationStateInfo to get a PS for the image
CheckPoint cp_GetPresentationStateInfo = new CheckPoint("Get PS Info", "Call PresentationStateService.GetPresentationStateInfo to get ps info");
r.CheckPoints.Add(cp_GetPresentationStateInfo);
XMLResult rt_GetPresentationStateInfo = psService.getPresentationStateInfo(p_getPresentationStateInfo);
if (true == ep_isReturnOK) // Expect the call returns OK
{
if (rt_GetPresentationStateInfo.IsErrorOccured)
{
cp_GetPresentationStateInfo.Result = TestResult.Fail;
cp_GetPresentationStateInfo.Outputs.AddParameter("get", "Get PS returns error", rt_GetPresentationStateInfo.Message);
}
else
{
cp_GetPresentationStateInfo.Result = TestResult.Pass;
cp_GetPresentationStateInfo.Outputs.AddParameter("get", "Get PS returns succeed", rt_GetPresentationStateInfo.Message);
// Check the return value is correct
#region Step 2: Check the values in PresentationStateService.getPresentationStateInfo return are correct
CheckPoint cp_getPSInfoReturn = new CheckPoint("Get PS Info", "Check the values in PresentationStateService.GetPresentationStateInfo return");
r.CheckPoints.Add(cp_getPSInfoReturn);
bool isValueEqual = false;
bool isKeyShow = false;
foreach (XMLParameterNode psNode in ep_getPresentationStateInfo.Parameters)
//.........这里部分代码省略.........
示例14: Run_3D_DeleteCrossSection_Case1159
// Case 1159: 1.9.3.2_deleteCrossSection
public void Run_3D_DeleteCrossSection_Case1159()
{
int runCount = 0;
foreach (InputDataSet ids in this.Input.DataSets)
{
runCount++;
Round r = this.NewRound(runCount.ToString(), ids.Description);
try
{
//Input parameters
string p_volumeUID = null;
XMLParameterCollection p_createCrossSection = new XMLParameterCollection();
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++)
{
if (ids.InputParameters.GetParameter(i).Step == "create_volumeUID")
{
p_volumeUID = ids.InputParameters.GetParameter(i).Value;
}
else if (ids.InputParameters.GetParameter(i).Step == "create_crosssection")
{
crosssection.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
}
else if (ids.InputParameters.GetParameter(i).Step == "create_slices_path_list")
{
slicesPathList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
}
else if (ids.InputParameters.GetParameter(i).Step == "create_slices_ps_xml_annotation_list")
{
slicesPSAnnotationList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
}
else if (ids.InputParameters.GetParameter(i).Step == "create_slices_ps_xml_general_list")
{
slicesPSGeneralList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
}
else if (ids.InputParameters.GetParameter(i).Step == "create_slices_ps_xml_processing_list")
{
slicesPSProcessingList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
}
else if (ids.InputParameters.GetParameter(i).Step == "create_slices_ps_thumbnail_path_list")
{
slicesThumbnailList.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
}
}
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();
#region Step 1: Call CrossSectionService.CreateCrossSection to create a new crosssection
CheckPoint cp_Create = new CheckPoint("Create", "Step 1: Call CrossSectionService.CreateCrossSection to create a new crosssection");
r.CheckPoints.Add(cp_Create);
XMLResult rt_Create = crossSectionSvc.createCrossSection(p_volumeUID, p_createCrossSection);
if (rt_Create.IsErrorOccured)
{
cp_Create.Result = TestResult.Fail;
cp_Create.Outputs.AddParameter("Create", "Create a new crosssection returns error", rt_Create.Message);
SaveRound(r);
break; // There is error, end test case
}
else
{
cp_Create.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)
{
cp_Create.Result = TestResult.Fail;
cp_Create.Outputs.AddParameter("Create", "Create a new crosssection returns wrong internal_id: ", rt_Create.Message);
SaveRound(r);
break; // There is error, end test case
}
else
{
//.........这里部分代码省略.........
示例15: Run_3D_deleteCrossSection_deleteallparents_Case1502
//Case 1502: 1.9.3.1_deleteCrossSection_localizer_has_three_parents_and_delete_all_parents
public void Run_3D_deleteCrossSection_deleteallparents_Case1502()
{
int runCount = 0;
foreach (InputDataSet ids in this.Input.DataSets)
{
runCount++;
Round r = this.NewRound(runCount.ToString(), "delete_all_cs_shared_localizer");
CheckPoint pCreate = new CheckPoint("Workflow", "delete_all_cs_shared_localizer");
r.CheckPoints.Add(pCreate);
CrossSectionService cs = new CrossSectionService();
XMLParameterCollection csInputData1 = new XMLParameterCollection();
XMLParameterCollection csInputData2 = new XMLParameterCollection();
XMLParameterCollection csInputData3 = new XMLParameterCollection();
XMLParameter cs1 = new XMLParameter("crosssection");
XMLParameter cs2 = new XMLParameter("crosssection");
XMLParameter cs3 = new XMLParameter("crosssection");
XMLParameter cs1_slicepath = new XMLParameter("slices_path_list");
XMLParameter cs2_slicepath = new XMLParameter("slices_path_list");
XMLParameter cs3_slicepath = new XMLParameter("slices_path_list");
XMLParameter cs1_slices_dicom_info_list = new XMLParameter("slices_dicom_info_list");
XMLParameter cs2_slices_dicom_info_list = new XMLParameter("slices_dicom_info_list");
XMLParameter cs3_slices_dicom_info_list = new XMLParameter("slices_dicom_info_list");
XMLParameter cs1_ps_xml_annotation_list = new XMLParameter("slices_ps_xml_annotation_list");
XMLParameter cs2_ps_xml_annotation_list = new XMLParameter("slices_ps_xml_annotation_list");
XMLParameter cs3_ps_xml_annotation_list = new XMLParameter("slices_ps_xml_annotation_list");
XMLParameter cs1_ps_xml_general_list = new XMLParameter("slices_ps_xml_general_list");
XMLParameter cs2_ps_xml_general_list = new XMLParameter("slices_ps_xml_general_list");
XMLParameter cs3_ps_xml_general_list = new XMLParameter("slices_ps_xml_general_list");
XMLParameter cs1_ps_xml_processing_list = new XMLParameter("slices_ps_xml_processing_list");
XMLParameter cs2_ps_xml_processing_list = new XMLParameter("slices_ps_xml_processing_list");
XMLParameter cs3_ps_xml_processing_list = new XMLParameter("slices_ps_xml_processing_list");
string volume1 = string.Empty;
string volume2 = string.Empty;
string volume3 = string.Empty;
for (int i = 0; i < ids.InputParameters.Count; i++)
{
switch (ids.InputParameters.GetParameter(i).Step)
{
case "volume1":
volume1 = ids.InputParameters.GetParameter(i).Value;
break;
case "createcs_crosssection":
cs1.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs2.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs3.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs_slices_dicom_info_list":
cs1_slices_dicom_info_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs2_slices_dicom_info_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs3_slices_dicom_info_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs_slices_ps_xml_annotation_list":
cs1_ps_xml_annotation_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs2_ps_xml_annotation_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs3_ps_xml_annotation_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs_slices_ps_xml_general_list":
cs1_ps_xml_general_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs2_ps_xml_general_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs3_ps_xml_general_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs_slices_ps_xml_processing_list":
cs1_ps_xml_processing_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs2_ps_xml_processing_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
cs3_ps_xml_processing_list.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs1_crosssection":
cs1.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs2_crosssection":
cs2.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs3_crosssection":
cs3.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs1_slices_path_list":
cs1_slicepath.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs2_slices_path_list":
cs2_slicepath.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
case "createcs3_slices_path_list":
cs3_slicepath.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value, false);
break;
}
}
csInputData1.Add(cs1);
//.........这里部分代码省略.........