<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Unit testing Entities</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Unit testing Entities</description>
  <pubDate>Wed, 29 Apr 2026 04:23:13 -700</pubDate>
  <lastBuildDate>Fri, 07 Dec 2007 13:24:39 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=590</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Unit testing Entities : Hi David,  Thanks for your answer. ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=590&amp;PID=2133#2133</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 590<br /><strong>Posted:</strong> 07-Dec-2007 at 1:24pm<br /><br />Hi David,<br /><br />Thanks for your answer.<br /> <br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by davidklitzke</strong></em><br /><br />Why do you want to avoid "hitting the database"? </td></tr></table> <br /> Going to the db will take some times and require to manage a test set in the database. In many case I just want to make a small unit test. <br /><br /> <table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by davidklitzke</strong></em><br /><br />You should start your most of your unit tests by creating a new instance of a PersistenceManager, in which case there will be nothing in the cache.   </td></tr></table> <br />I was afraid that it would grow to a point where my test take for long time. I have a so low test coverage (:oops:) that it is actually not a problem right now but I am up to almost 10s for the part the unit test (not file, db test). I hope that it won't grow linear.<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by davidklitzke</strong></em><br /><br />In any case, you shouldn't have any dependencies going from one test to another. </td></tr></table> <br />I totally agree with that, wich means that many test will need to do som setup/teardown to the base also when testing "pure logic".<br /><br />I'll follow your advice of using a new PersistManager and see how it goes. If it make testing easier and doesn't consume too much time, that will be good enough for me.<br /><span style="font-size:10px"><br /><br />Edited by Dominique - 07-Dec-2007 at 1:24pm</span>]]>
   </description>
   <pubDate>Fri, 07 Dec 2007 13:24:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=590&amp;PID=2133#2133</guid>
  </item> 
  <item>
   <title>Unit testing Entities : Why do you want to avoid &amp;#034;hitting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=590&amp;PID=2119#2119</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 590<br /><strong>Posted:</strong> 07-Dec-2007 at 8:52am<br /><br />Why do you want to avoid "hitting the database"?&nbsp; Almost all of our unit tests use a "test" database.&nbsp; If you don't need to use a database to get your data, that's fine too, but I wouldn't go out of my way if using a database is easier.<DIV>&nbsp;</DIV><DIV>You should start your most of your unit tests by creating a new instance of a PersistenceManager, in which case there will be nothing in the cache.&nbsp; In any case, you shouldn't have any dependencies going from one test to another.</DIV>]]>
   </description>
   <pubDate>Fri, 07 Dec 2007 08:52:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=590&amp;PID=2119#2119</guid>
  </item> 
  <item>
   <title>Unit testing Entities : Hi,  I can&amp;#039;t find a good...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=590&amp;PID=2115#2115</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 590<br /><strong>Posted:</strong> 06-Dec-2007 at 11:40pm<br /><br />Hi,<br /><br />I can't find a good solution for writing unit tests without hitting the database. Do you have any tips on how I could do that?<br />My first problem is the management of the enum classes, it looks like you need to go to the db to initialize them. An other point is the management of the cache between test, how can I clean the cache of entities created in the test without reaping off initial values like enum classes?<br /><br />Thanks for any advice :)]]>
   </description>
   <pubDate>Thu, 06 Dec 2007 23:40:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=590&amp;PID=2115#2115</guid>
  </item> 
 </channel>
</rss>