<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Joaquín Vano's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/joaquinv/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/joaquinv/feed.xml</link>
    <description>.Net Development, Security, Design Patterns, Architecture</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:41:37 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>while(*a++=*b++);</title>
      <link>https://docs.microsoft.com/archive/blogs/joaquinv/whileab</link>
      <pubDate>Mon, 30 Mar 2009 20:12:00 GMT</pubDate>
      <dc:creator><![CDATA[joaquinv]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joaquinv/2009/03/30/whileab/</guid>
      <description><![CDATA[For those who do not understand what "while(*a++=*b++);" does, I posted a sample in C#&nbsp;for you...]]></description>
      <content:encoded><![CDATA[<P>For those who do not understand what "while(*a++=*b++);" does, I posted a sample in C#&nbsp;for you to know. I use C# beacuse I'm using a shared PC...</P>
<P>The key is that * means for a reference to a type when at type declaration, but when we use it in a statement * means that we want the content that is referenced by the pointer. In the sample below,&nbsp;&nbsp;*a means tha we want the content of the character at the memory at some address that is holded by the pointer a; and when we use a++ we want to move forward the addres of the pointer to the next character. Another thing to know is that when use the assignmente operator = , it returns the value just assgined, so when you type char x =&nbsp; *a = *b; x will have the value just copied from&nbsp;b adress&nbsp;to a&nbsp;adress. Last but not least, the while operator is looking for some value greater than 0 in order to continue the loop. If you remember you C/C++ classes all the strings finishes with a '\0' character that&nbsp;is equal to&nbsp;0&nbsp;as an&nbsp;integer value. That´s why the while breakes&nbsp;at the end of the string, and that´s why it´s can be used to copy strings.</P>
<P>&nbsp;Obviously you wont use this code in real life, but could be interesting for those you are not experienced on pointers.</P><FONT color=#0000ff size=1><FONT color=#0000ff size=1>
<P>unsafe<BR></FONT></FONT><FONT size=1>{<BR></FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT>IntPtr</FONT></FONT><FONT size=1> ptrA = </FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>Marshal</FONT></FONT><FONT size=1>.StringToBSTR(</FONT><FONT color=#a31515 size=1><FONT color=#a31515 size=1>"hola"</FONT></FONT><FONT size=1>); </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Convert Managed String to Unmanaged char array<BR>&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>IntPtr</FONT></FONT><FONT size=1> ptrB = </FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>Marshal</FONT></FONT><FONT size=1>.StringToBSTR(</FONT><FONT color=#a31515 size=1><FONT color=#a31515 size=1>"HOLA"</FONT></FONT><FONT size=1>); </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Convert Managed String to Unmanaged char array<BR><BR>&nbsp;&nbsp;&nbsp; </FONT></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>char</FONT></FONT><FONT size=1>* a = (</FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>char</FONT></FONT><FONT size=1>*)ptrA.ToPointer(); </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Reference to the first character of string "hola"<BR></FONT></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>&nbsp;&nbsp;&nbsp; char</FONT></FONT><FONT size=1>* b = (</FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>char</FONT></FONT><FONT size=1>*)ptrB.ToPointer(); </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Reference to the first character of string "HOLA" <BR></FONT></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>&nbsp;&nbsp;&nbsp; char</FONT></FONT><FONT size=1>* start = a; </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Keep reference to the first character</P></FONT></FONT><FONT size=1>
<P></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>&nbsp;&nbsp;&nbsp; while</FONT></FONT><FONT size=1> ((*a++ = *b++) != 0); </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Do the strcpy</P></FONT></FONT><FONT size=1>
<P></FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>&nbsp;&nbsp;&nbsp; string</FONT></FONT><FONT size=1> str = </FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>Marshal</FONT></FONT><FONT size=1>.PtrToStringBSTR(</FONT><FONT color=#0000ff size=1><FONT color=#0000ff size=1>new</FONT></FONT><FONT size=1> </FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>IntPtr</FONT></FONT><FONT size=1>(start)); </FONT><FONT color=#008000 size=1><FONT color=#008000 size=1>// Converto Unmanaged char array to Managed String in order to print<BR></FONT></FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>&nbsp;&nbsp;&nbsp; Console</FONT></FONT><FONT size=1>.WriteLine(</FONT><FONT color=#a31515 size=1><FONT color=#a31515 size=1>"STRCPY Result {0}"</FONT></FONT><FONT size=1>, str);<BR></FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>&nbsp;&nbsp;&nbsp; Console</FONT></FONT><FONT size=1>.WriteLine(</FONT><FONT color=#a31515 size=1><FONT color=#a31515 size=1>"Press any key to continue..."</FONT></FONT><FONT size=1>);<BR>&nbsp;&nbsp;&nbsp; </FONT><FONT color=#2b91af size=1><FONT color=#2b91af size=1>Console</FONT></FONT><FONT size=1>.ReadLine();<BR></FONT><FONT size=1>}</P></FONT>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Execute Oracle Stored Procedure in SQL Server</title>
      <link>https://docs.microsoft.com/archive/blogs/joaquinv/execute-oracle-stored-procedure-in-sql-server</link>
      <pubDate>Thu, 23 Oct 2008 19:11:00 GMT</pubDate>
      <dc:creator><![CDATA[joaquinv]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joaquinv/2008/10/23/execute-oracle-stored-procedure-in-sql-server/</guid>
      <description><![CDATA[Executing an Oracle Stored Procedure is a common task using a data access technology like ADO.NET...]]></description>
      <content:encoded><![CDATA[<P>Executing an Oracle Stored Procedure is a common task using a data access technology like ADO.NET and is not so common to execute Oracle procs from SQL Server Procedures but in some cases is needed. For example, I used a scheduled stored procedure in SQL Server to process some data on daily basis and this procedure was encharged of updating some data on an Oracle Database. First we suggest pushing data to an Oracle table using the OPENQUERY statement, but the requirement was to validate some data at the Oracle Database. So we needed to execute an Oracle stored procedure in order to archieve this requirement. So for all you guys that are trying to execute an Oracle Stored Procedure from SQL Server you can try the following:</P>
<P mce_keep="true">We made a sample package named SBD with the procedure named TestProcedure:</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="mso-fareast-font-family: 'Times New Roman'"><FONT size=3><FONT face="Times New Roman"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'">Package Header:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'">PROCEDURE TestProcedure<BR>(<BR>&nbsp;&nbsp;&nbsp; I_Parameter1 IN NUMBER,<BR>&nbsp;&nbsp;&nbsp; I_Parameter2 IN NUMBER,<BR>&nbsp;&nbsp;&nbsp; O_Parameter1 OUT NUMBER,<BR>&nbsp;&nbsp;&nbsp; O_Parameter2 OUT NUMBER<BR>);</SPAN><SPAN style="mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="mso-fareast-font-family: 'Times New Roman'"><FONT size=3><FONT face="Times New Roman">&nbsp;<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'">Package Body:</SPAN><SPAN style="mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'">PROCEDURE TestProcedure<BR>(<BR>&nbsp;&nbsp;&nbsp; I_Parameter1 IN NUMBER,<BR>&nbsp;&nbsp;&nbsp; I_Parameter2 IN NUMBER,<BR>&nbsp;&nbsp;&nbsp; O_Parameter1 OUT NUMBER,<BR>&nbsp;&nbsp;&nbsp; O_Parameter2 OUT NUMBER<BR>) AS<BR>BEGIN<BR>&nbsp;&nbsp; O_Parameter1 := I_Parameter1 + 1;<BR>&nbsp;&nbsp; O_Parameter2 := I_Parameter2 + 1;<BR>END TestProcedure;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'">Then we create a SQL Server Stored Procedure to Wrapp the Oracle Store Procedure Invocation, the T-SQL inside the procedure&nbsp;for this sample is the following:</SPAN><SPAN style="mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></SPAN></P><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>DECLARE</FONT></FONT><FONT size=2> @l_i_parameter1 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>INTEGER<BR>DECLARE</FONT></FONT><FONT size=2> @l_i_parameter2 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>INTEGER</FONT></FONT><FONT size=2> <BR></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>DECLARE</FONT></FONT><FONT size=2> @l_o_parameter1 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>INTEGER<BR></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>DECLARE</FONT></FONT><FONT size=2> @l_o_parameter2 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>INTEGER</P>
<P>SET</FONT></FONT><FONT size=2> @l_i_parameter1 </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> 5<BR></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>SET</FONT></FONT><FONT size=2> @l_i_parameter2 </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> 10<BR></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>SET</FONT></FONT><FONT size=2> @l_o_parameter1 </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> 0<BR></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>SET</FONT></FONT><FONT size=2> @l_o_parameter2 </FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>=</FONT></FONT><FONT size=2> 0</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>EXECUTE </FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>(</FONT></FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000 size=2>'begin SDB.TestProcedure(?,?,?,?); end;'</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @l_i_parameter1</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @l_i_parameter2</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @l_o_parameter1 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>OUTPUT</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @l_o_parameter2 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>OUTPUT</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>)</FONT></FONT><FONT size=2> AT DBLINK_NAME</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>;</P></FONT></FONT>
<P mce_keep="true"><FONT color=#0000ff size=2><FONT color=#0000ff size=2>SELECT</FONT></FONT><FONT size=2> @l_o_parameter1</FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>,</FONT></FONT><FONT size=2> @l_o_parameter2 </P>
<P mce_keep="true"></FONT>I Hope this sample ilustrate the concept. Also I want to mention that this sample only works with simple output parameters, if you are trying to query for resultsets I recommend to try the OPENQUERY statement insteed.</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Components without services as a test framework for data access object testing</title>
      <link>https://docs.microsoft.com/archive/blogs/joaquinv/components-without-services-as-a-test-framework-for-data-access-object-testing</link>
      <pubDate>Tue, 14 Feb 2006 23:26:00 GMT</pubDate>
      <dc:creator><![CDATA[joaquinv]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joaquinv/2006/02/14/components-without-services-as-a-test-framework-for-data-access-object-testing/</guid>
      <description><![CDATA[Visual Studio 2005 includes a set of nice tools for software quality assurance, but not all this...]]></description>
      <content:encoded><![CDATA[<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Visual Studio 2005 includes a set of nice tools for software quality assurance, but not all this tools are magic, especially when we are looking for data access object tests. Usually these kinds of objects are the data access abstraction layer for any tiered application. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">One of the biggest problems in data access object testing, are the unstable state of the underling data source and a lot of solutions emerge to fix this problem, like , mock objects, database transactions, compensation transactions, and so on. Plainly all those solutions require a little beat of effort and on some cases there is no possible to create a test case.<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Hopefully COM+ technology in the version 1.5 presents a new kind of enterprise service called <I style="mso-bidi-font-style: normal">Services without Components</I>, where you can use the services provided by COM+ without needing to build a ServicedComponent. By using COM+ services without components, we can avoid the overhead of creating a component that is used to access only the COM+ services we need to build our DAL unit testing.<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">The Unit Testing of Microsoft Quality Tools from Visual Studio 2005 provides a great framework from our integrated test development environment. It arrives with a set of custom method attributes that permit us to introduce some code at the initialization of the test, the test itself and at the end of test to cleanup the logic applied to the test. Obviously the idea was to provide a test framework that provides us the option to hook COM+ 1.5 services for our convenience.<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">The following code shows how easy is to enlist the component on a distributed transaction coordinated by the DTC. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>At test cleanup we can abort the transaction to leave the data source in the same state prior to test execution.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">[TestClass]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> TransactionalTest<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>[TestInitialize]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">void</SPAN> Initialize()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ServiceConfig config = <SPAN style="COLOR: blue">new</SPAN> ServiceConfig();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>config.Transaction = TransactionOption.RequiresNew;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ServiceDomain.Enter(config);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>[TestMethod]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">void</SPAN> DatabaseOperationTest()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Some CRUD operation<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>[TestCleanup]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">void</SPAN> Cleanup()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (ContextUtil.IsInTransaction)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ContextUtil.SetAbort();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ServiceDomain.Leave();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">I hope this brief explication can help on your test driven developments. <o:p></o:p></SPAN></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Happy coding!<o:p></o:p></SPAN></P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
  </channel>
</rss>