CTestedClass.xml 2.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="MockDemo.CTestedClass">
<Import>Fw</Import>
<Super>%RegisteredObject</Super>
<TimeCreated>64377,68751.494372</TimeCreated>

<Property name="mathService">
<Type>MathService</Type>
<Private>1</Private>
</Property>

<Method name="%OnNew">
<FormalSpec>mathService:MathService=##class(MathService).%New()</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
   set ..mathService = mathService
   quit $$$OK
]]></Implementation>
</Method>

<Method name="SumOperation">
<FormalSpec>A:%Integer,B:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[   quit ..mathService.Add(A, B)
]]></Implementation>
</Method>

<Method name="ComplexOperation">
<FormalSpec><![CDATA[A:%Integer,B:%Integer,&status:%Status=$$$OK]]></FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
   if (..mathService.GreaterThan(A, B))
   {
      quit ..mathService.Divide(A, B, .status)
   }
   else
   {
      quit ..mathService.Multiply(A, B, .status)
   }
]]></Implementation>
</Method>

<Method name="FetchSQLQueryInformation">
<FormalSpec>input:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
   #Dim returnedValue As %String = ""
   
   #Dim rs As %ResultSet = ##class(CResultSetTools).GetNewResultSet($ClassName() _ ":MyQuery")
   do rs.Execute(input)
   if (rs.Next())
   {
      set returnedValue = rs.ResultA _ "+" _ rs.ResultB
   }
      
   quit returnedValue
]]></Implementation>
</Method>

<Query name="MyQuery">
<Type>%SQLQuery</Type>
<FormalSpec>input:%String</FormalSpec>
<SqlQuery>   select 'A' As ResultA, :input As ResultB</SqlQuery>
</Query>

<Method name="FetchSQLPrepareInformation">
<FormalSpec>input:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
   #Dim returnedValue As %String = ""
   
   #Dim rs As %ResultSet = ##class(CResultSetTools).GetNewResultSet("")
   do rs.Prepare("select 'B' As ResultA, ? As ResultB")
   do rs.Execute(input)
   while (rs.Next())
   {
      set returnedValue = (returnedValue _ "|" _ rs.ResultA _ "+" _ rs.ResultB)
   }
   
   quit returnedValue
]]></Implementation>
</Method>

<Method name="PopulateObjectProperties">
<FormalSpec><![CDATA[&hl7Message:EnsLib.HL7.Message,searchTable:EnsLib.XML.SearchTable]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
   // Build a stream
   set expectedStream = ##class(%Stream.TmpCharacter).%New()
   do expectedStream.Write("This is some content")
   
   quit ..mathService.GetResult(.hl7Message, searchTable, expectedStream)
]]></Implementation>
</Method>
</Class>
</Export>