<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx</link><description>Summary: In this article I’ll show what problems we encounter today when we perform unit tests against database related component, and the various ways used to solve these problems. I’ll also show a new method to solve these problems, which is far easier</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#1959230</link><pubDate>Thu, 08 Mar 2007 07:24:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1959230</guid><dc:creator>Oscar Land</dc:creator><author>Oscar Land</author><description>&lt;p&gt;Dear Roy,&lt;/p&gt;
&lt;p&gt;Could you pleased upload the source code sample of this article?&lt;/p&gt;
&lt;p&gt;I couldn't make test with this. The error : &lt;/p&gt;
&lt;p&gt;TestFixture failed: Invalid ServicedComponent-derived classes were found in the assembly.&lt;/p&gt;
&lt;p&gt;Thanks. Best regards.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1959230" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#1413796</link><pubDate>Mon, 15 Jan 2007 13:02:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1413796</guid><dc:creator>Fariba Ahvaz</dc:creator><author>Fariba Ahvaz</author><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a problem in using com+ for transaction.&lt;/p&gt;
&lt;p&gt;I used to use vb.net 2003. My program's architecture is 5 layers.&lt;/p&gt;
&lt;p&gt;The Business objects and dataobjects are com+ objects.I use tcp channel for remoting and the atributes for com+ that I use are :&lt;/p&gt;
&lt;p&gt;&amp;lt;Assembly: ApplicationName(&amp;quot;App Name&amp;quot;)&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;lt;Assembly: ApplicationAccessControl(True)&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;lt;Assembly: ApplicationActivation(ActivationOption.Server)&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;lt;ComponentAccessControl(True), _&lt;/p&gt;
&lt;p&gt;SecurityRole(&amp;quot;MyRole&amp;quot;, True), _&lt;/p&gt;
&lt;p&gt;Transaction(TransactionOption.Required)&amp;gt; &lt;/p&gt;
&lt;p&gt;and for all of my functions I use try/catch .at the end of try I use ContextUtil.SetComplete and In catch I use Contextutil.SetAbort. also I Inherit a class from Exception for my own exception.&lt;/p&gt;
&lt;p&gt;but In one function I call 3 other functions.when the error of remoting has raised or when I throw my own exception, SetAbort does not work.&lt;/p&gt;
&lt;p&gt;I will be glad If someone help.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1413796" width="1" height="1"&gt;</description></item><item><title>DataFresh - Database rollback library for unit tests</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#660754</link><pubDate>Fri, 13 Oct 2006 23:43:20 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:660754</guid><dc:creator>ISerializable - Roy Osherove's Blog</dc:creator><author>ISerializable - Roy Osherove's Blog</author><description>&lt;p&gt;A while ago I wrote an article about database unit testing, and the various ways you could &amp;quot;rollback&amp;quot;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=660754" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#660041</link><pubDate>Fri, 13 Oct 2006 19:12:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:660041</guid><dc:creator>Mike Brockey</dc:creator><author>Mike Brockey</author><description>I have yet another solution to this very common problem. We have been able to isolate the steps for preparing a database snapshot, tracking the database modifications and then refreshing the modified tables back to their original state all using built in sql statements.  We call it dataFresh and it is available now from our website as part of our TDD Developer's Toolkit, all free of charge.

http://blogs.ent0.com/blogs/datafresh/default.aspx
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=660041" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#588888</link><pubDate>Wed, 27 Sep 2006 18:32:16 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:588888</guid><dc:creator>Joe</dc:creator><author>Joe</author><description>I like your solution.  I have a knowlege hole though, when you said "you ARE using a test database...".

I don't see how, in the .net environment, to get all the connections that exist in all the forms changed back &amp; forth from the test to the production database.

Is there a book or website that describes this architecture and process?

Thanks
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=588888" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#461670</link><pubDate>Mon, 31 Jul 2006 15:40:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:461670</guid><dc:creator>Ian Blackburn</dc:creator><author>Ian Blackburn</author><description>Roy,

There is an even simpler way of doing this using .Net 2 and TransactionScope - see http://www.bbits.co.uk/blog/archive/2006/07/31/12741.aspx for details.

Cheers

Ian&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=461670" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#460116</link><pubDate>Mon, 24 Jul 2006 16:59:13 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:460116</guid><dc:creator>Colin Jack</dc:creator><author>Colin Jack</author><description>I've tried using this, specifically using the DataRollbackAttribute, but keep getting wierd MSDTC Transaction Errors:

http://groups.google.co.uk/group/microsoft.public.dotnet.framework.component_services/browse_thread/thread/ae13b44beda812e5/29b5c9dfc68003fb?lnk=st&amp;q=&amp;rnum=1&amp;hl=en#29b5c9dfc68003fb

The only thing I didn't include in that post was that some of the errors have the code XACT_E_NOTRANSACTION in them.

Anyway I found one other post on the newsgroups from someone who was trying to use the ES approach and had the same issue so I wondered if anyone else has seen it and/or solved it?&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=460116" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#454208</link><pubDate>Wed, 21 Jun 2006 15:33:32 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:454208</guid><dc:creator>Yale</dc:creator><author>Yale</author><description>if i have local transactions in the code, the test gives me error: System.InvalidOperationException: OracleConnection does not support parallel transactions&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=454208" width="1" height="1"&gt;</description></item><item><title>re: Simplified Database Unit testing using Enterprise Services</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#454082</link><pubDate>Tue, 20 Jun 2006 19:13:18 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:454082</guid><dc:creator>Yale</dc:creator><author>Yale</author><description>in my code i have transactions, my test code gives me error saying:  "OracleConnection does not support parallel transactions."&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=454082" width="1" height="1"&gt;</description></item><item><title>NUint的使用二 [原创]</title><link>http://weblogs.asp.net/rosherove/pages/DbUnitTesting.aspx#379385</link><pubDate>Wed, 23 Feb 2005 20:57:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:379385</guid><dc:creator>TrackBack</dc:creator><author>TrackBack</author><description>Ping Back来自：blog.csdn.net&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=379385" width="1" height="1"&gt;</description></item></channel></rss>