﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ciaran Jessup commented on Test refacotring</title><description>I didn't mean to cause offence, was just interested!  And i'll take your word for it then :)
</description><link>http://ayende.com/3965/test-refacotring#comment15</link><guid>http://ayende.com/3965/test-refacotring#comment15</guid><pubDate>Tue, 21 Apr 2009 07:51:42 GMT</pubDate></item><item><title>Ayende Rahien commented on Test refacotring</title><description>Ciaran,
  
a) no
  
b) you haven't asked what I am testing, this is part of the NH Search test suite
</description><link>http://ayende.com/3965/test-refacotring#comment14</link><guid>http://ayende.com/3965/test-refacotring#comment14</guid><pubDate>Tue, 21 Apr 2009 07:49:53 GMT</pubDate></item><item><title>Ciaran Jessup commented on Test refacotring</title><description>Interesting,  does this not slow down your tests a lot ? 
</description><link>http://ayende.com/3965/test-refacotring#comment13</link><guid>http://ayende.com/3965/test-refacotring#comment13</guid><pubDate>Tue, 21 Apr 2009 07:48:16 GMT</pubDate></item><item><title>Ayende Rahien commented on Test refacotring</title><description>Ciaran,
  
The lack of context is tripping you.
  
In fact, I am blowing away the database _schema_ each time I run the test.
  
  
</description><link>http://ayende.com/3965/test-refacotring#comment12</link><guid>http://ayende.com/3965/test-refacotring#comment12</guid><pubDate>Tue, 21 Apr 2009 07:45:44 GMT</pubDate></item><item><title>Ciaran Jessup commented on Test refacotring</title><description>I notice in your OnTearDown you're deleting every mapped thing in your NHibernate Configuration, which means (unless I'm mistaken, which I could well be) that if there was any data in there that was global reference data that was shared by all tests it would be blown away.
  
  
I've always been told to strive for Idempotence in my tests so would traditonally have just removed what I created in my setup, am I wasting my time with this approach ?   
  
  
In a non-trivial test where you can setup the entire database as you need it in your setup then I guess its ok to do this each time, but when you're running hundreds or thousands of tests over a complex system that has data that has a lot of shared reference values that would slow the tests down quite a lot I think ?
</description><link>http://ayende.com/3965/test-refacotring#comment11</link><guid>http://ayende.com/3965/test-refacotring#comment11</guid><pubDate>Tue, 21 Apr 2009 07:43:47 GMT</pubDate></item><item><title>John Simons commented on Test refacotring</title><description>Not sure if it's intentional or not but you may want to fix the spelling mistake "Refactoring" Cheers John
</description><link>http://ayende.com/3965/test-refacotring#comment10</link><guid>http://ayende.com/3965/test-refacotring#comment10</guid><pubDate>Mon, 20 Apr 2009 22:10:08 GMT</pubDate></item><item><title>Victor Kornov commented on Test refacotring</title><description>@Frank Quednau
  
I'd say that's naming convention in NH which Oren just follows.
</description><link>http://ayende.com/3965/test-refacotring#comment9</link><guid>http://ayende.com/3965/test-refacotring#comment9</guid><pubDate>Mon, 20 Apr 2009 21:43:09 GMT</pubDate></item><item><title>Frank Quednau commented on Test refacotring</title><description>Finally  a prominent proponent for PascalCasedTestNames. All_this_underscore_separation_is_getting_out_of_hand! ;)
</description><link>http://ayende.com/3965/test-refacotring#comment8</link><guid>http://ayende.com/3965/test-refacotring#comment8</guid><pubDate>Mon, 20 Apr 2009 20:53:55 GMT</pubDate></item><item><title>Benny Thomas commented on Test refacotring</title><description>@Ayende: I know it's not worth it, but it is good practice. And this is codesmell and people who wan't to learn what happens behind the scene will get a nearly Kobe feeling ;)
  
  
The power of example.
</description><link>http://ayende.com/3965/test-refacotring#comment7</link><guid>http://ayende.com/3965/test-refacotring#comment7</guid><pubDate>Mon, 20 Apr 2009 20:35:03 GMT</pubDate></item><item><title>Jonathan Allen commented on Test refacotring</title><description>So instead of a single test you can easily follow you have a tangle of implied function calls.
  
  
And what if one of those implied calls, say "OnSetUp" fails? Do you get bombarded with false positives or does it just silently ignore your tests?
  
  
And what if you want a different setup? Do you have to build a whole new class for each data scenario?
  
  
The original test wasn't perfect, but this new one seems to be both over engineered and inflexible at the same time.
</description><link>http://ayende.com/3965/test-refacotring#comment6</link><guid>http://ayende.com/3965/test-refacotring#comment6</guid><pubDate>Mon, 20 Apr 2009 20:09:01 GMT</pubDate></item><item><title>Ayende Rahien commented on Test refacotring</title><description>Benny,
  
Not worth it, this is not a test for an application, this is a test for NH Search, so we have LOTS of stuff like that
</description><link>http://ayende.com/3965/test-refacotring#comment5</link><guid>http://ayende.com/3965/test-refacotring#comment5</guid><pubDate>Mon, 20 Apr 2009 19:36:19 GMT</pubDate></item><item><title>Ayende Rahien commented on Test refacotring</title><description>John,
  
What you don't see here is that there are transaction syncronizations going on behind the scene to sync the index.
  
I have to use tx.
</description><link>http://ayende.com/3965/test-refacotring#comment4</link><guid>http://ayende.com/3965/test-refacotring#comment4</guid><pubDate>Mon, 20 Apr 2009 19:35:27 GMT</pubDate></item><item><title>Benny Thomas commented on Test refacotring</title><description>I'm missing the factory method for Author, Order and Product.
</description><link>http://ayende.com/3965/test-refacotring#comment3</link><guid>http://ayende.com/3965/test-refacotring#comment3</guid><pubDate>Mon, 20 Apr 2009 19:11:52 GMT</pubDate></item><item><title>John commented on Test refacotring</title><description>And replacing tx.Commit with s.Flush(); s.Clear(); in your tests
</description><link>http://ayende.com/3965/test-refacotring#comment2</link><guid>http://ayende.com/3965/test-refacotring#comment2</guid><pubDate>Mon, 20 Apr 2009 18:49:51 GMT</pubDate></item><item><title>John commented on Test refacotring</title><description>Instead of cleaning up using deletes, why don't you just rollback the transaction?
</description><link>http://ayende.com/3965/test-refacotring#comment1</link><guid>http://ayende.com/3965/test-refacotring#comment1</guid><pubDate>Mon, 20 Apr 2009 18:47:00 GMT</pubDate></item></channel></rss>