<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments for Graeme Hill on .NET development</title>
	<atom:link href="http://graemehill.ca/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://graemehill.ca</link>
	<description></description>
	<pubDate>Fri, 30 Jul 2010 13:21:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Unit testing an Entity Framework DAL part 2: Rolling back the test database by ShantiDev</title>
		<link>http://graemehill.ca/unit-testing-an-entity-framework-data-access-layer-part-2-rolling-back-the-test-database/comment-page-1#comment-708</link>
		<dc:creator>ShantiDev</dc:creator>
		<pubDate>Tue, 13 Jul 2010 13:02:54 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=134#comment-708</guid>
		<description>Gr8 if u r using SQL Server.</description>
		<content:encoded><![CDATA[<p>Gr8 if u r using SQL Server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Unit testing an Entity Framework DAL part 1: Just hit the database by ShantiDev</title>
		<link>http://graemehill.ca/unit-testing-an-entity-framework-data-access-layer-part-1-just-hit-the-database/comment-page-1#comment-707</link>
		<dc:creator>ShantiDev</dc:creator>
		<pubDate>Tue, 13 Jul 2010 12:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=119#comment-707</guid>
		<description>Firstly thanks for this contribution I think this is a critically important aspect of TDD, Agile Development and Automated Testing which is not adequately covered in most books, articles and blogs.

Although your blog is specific to Entity Framework, I think it is worth looking at other Solutions and seeing how these could be adapted to Entity Framework or how Entity Framework could be adapted to make testing without actually hitting the DB simpler.

We all accept that as part of your test pack there are going to be integration tests and Acceptance tests that actually hit the Database.

In my experience there are a whole range of tests (Call them integration tests if you want) that need to persist some objects and load them again. Projects with complex processing logic etc.

In all these cases you either need a database or you need to be able to Fake a data access layer.

If you are using a framework such as Habanero or NHibernate this should be relatively simple since these pretty much ensure that database differences are accounted for.

Habanero uses an InMemoryDatabase which is a Fake it behaves exactly like a real database as far as Habanero is concerns and implements all the same constraints etc.

I have used this on my last few projects and found it to be incredibly simple, usable and resulted in incredibly fast tests with no test interactions etc. It worked so well that when I touch an old project I automatically change to using the InMemory 
The In Memory Database just stores the objects. You don't need to propogate schema changes to it etc etc.

It was obviously a bit of work to create but the Habanero guys have already done it.

The unintended benefits of using the In Memory database for Agile developement is that we have found that we are doing large chunks of development using just Business Objects and the In Memory database (No adding removing columns/Table etc from the Database). Even the visual testing by the developer is done using an In Memory Database. When you go into stabilisation i.e. testing by testers before deployment we generate the DB Schema and run our Database integration and acceptance tests and then  do visual testing.

Sorry for the long reply but I have found this feature incredibly usefull and very supportive of Agile development and I would like to see it incorporated into other frameworks.

Shanti Dev</description>
		<content:encoded><![CDATA[<p>Firstly thanks for this contribution I think this is a critically important aspect of TDD, Agile Development and Automated Testing which is not adequately covered in most books, articles and blogs.</p>
<p>Although your blog is specific to Entity Framework, I think it is worth looking at other Solutions and seeing how these could be adapted to Entity Framework or how Entity Framework could be adapted to make testing without actually hitting the DB simpler.</p>
<p>We all accept that as part of your test pack there are going to be integration tests and Acceptance tests that actually hit the Database.</p>
<p>In my experience there are a whole range of tests (Call them integration tests if you want) that need to persist some objects and load them again. Projects with complex processing logic etc.</p>
<p>In all these cases you either need a database or you need to be able to Fake a data access layer.</p>
<p>If you are using a framework such as Habanero or NHibernate this should be relatively simple since these pretty much ensure that database differences are accounted for.</p>
<p>Habanero uses an InMemoryDatabase which is a Fake it behaves exactly like a real database as far as Habanero is concerns and implements all the same constraints etc.</p>
<p>I have used this on my last few projects and found it to be incredibly simple, usable and resulted in incredibly fast tests with no test interactions etc. It worked so well that when I touch an old project I automatically change to using the InMemory<br />
The In Memory Database just stores the objects. You don&#8217;t need to propogate schema changes to it etc etc.</p>
<p>It was obviously a bit of work to create but the Habanero guys have already done it.</p>
<p>The unintended benefits of using the In Memory database for Agile developement is that we have found that we are doing large chunks of development using just Business Objects and the In Memory database (No adding removing columns/Table etc from the Database). Even the visual testing by the developer is done using an In Memory Database. When you go into stabilisation i.e. testing by testers before deployment we generate the DB Schema and run our Database integration and acceptance tests and then  do visual testing.</p>
<p>Sorry for the long reply but I have found this feature incredibly usefull and very supportive of Agile development and I would like to see it incorporated into other frameworks.</p>
<p>Shanti Dev</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A lesson on using closed source libraries by wills</title>
		<link>http://graemehill.ca/a-lesson-on-using-closed-source-libraries/comment-page-1#comment-706</link>
		<dc:creator>wills</dc:creator>
		<pubDate>Mon, 12 Jul 2010 02:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=318#comment-706</guid>
		<description>That rocks :P 

The number of gotchas in Linq-to-sql is definitely becoming mind-numbing.</description>
		<content:encoded><![CDATA[<p>That rocks <img src='http://graemehill.ca/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>The number of gotchas in Linq-to-sql is definitely becoming mind-numbing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding all validation errors on an IDataErrorInfo object by Neal Gabriel</title>
		<link>http://graemehill.ca/finding-all-validation-errors-on-an-idataerrorinfo-object/comment-page-1#comment-705</link>
		<dc:creator>Neal Gabriel</dc:creator>
		<pubDate>Sun, 11 Jul 2010 07:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=174#comment-705</guid>
		<description>Hi, 
First of all, Thank you for this helpful post. Can you please add an example on how to call this method (GetValidationErrors) in a class. In short How can I use this method?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
First of all, Thank you for this helpful post. Can you please add an example on how to call this method (GetValidationErrors) in a class. In short How can I use this method?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Discard changes in LINQ to SQL DataContext by Graeme</title>
		<link>http://graemehill.ca/discard-changes-in-linq-to-sql-datacontext/comment-page-1#comment-701</link>
		<dc:creator>Graeme</dc:creator>
		<pubDate>Mon, 28 Jun 2010 15:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=5#comment-701</guid>
		<description>The only reason I can think of that would cause that line to fail in C# is that you need to have parenthesis at the end of the GetType function.  Here's my conversion of that function.  Sorry, the formatting will be all screwy.

        public void DiscardInsertsAndDeletes(DataContext data)
        {
            var changes = data.GetChangeSet();

            foreach (var insertion in changes.Inserts)
            {
                data.GetTable(insertion.GetType()).DeleteOnSubmit(insertion);
            }

            foreach (var deletion in changes.Deletes)
            {
                data.GetTable(deletion.GetType()).InsertOnSubmit(deletion);
            }
        }</description>
		<content:encoded><![CDATA[<p>The only reason I can think of that would cause that line to fail in C# is that you need to have parenthesis at the end of the GetType function.  Here&#8217;s my conversion of that function.  Sorry, the formatting will be all screwy.</p>
<p>        public void DiscardInsertsAndDeletes(DataContext data)<br />
        {<br />
            var changes = data.GetChangeSet();</p>
<p>            foreach (var insertion in changes.Inserts)<br />
            {<br />
                data.GetTable(insertion.GetType()).DeleteOnSubmit(insertion);<br />
            }</p>
<p>            foreach (var deletion in changes.Deletes)<br />
            {<br />
                data.GetTable(deletion.GetType()).InsertOnSubmit(deletion);<br />
            }<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Discard changes in LINQ to SQL DataContext by Scott</title>
		<link>http://graemehill.ca/discard-changes-in-linq-to-sql-datacontext/comment-page-1#comment-700</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Mon, 28 Jun 2010 06:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=5#comment-700</guid>
		<description>Can anyone convert the DiscardInsertsAndDeletes() and DiscardUpdates() methods to C#?  I can't get data.GetTable(insertion.GetType).DeleteOnSubmit(insertion)
 to work properly.  Thank you.</description>
		<content:encoded><![CDATA[<p>Can anyone convert the DiscardInsertsAndDeletes() and DiscardUpdates() methods to C#?  I can&#8217;t get data.GetTable(insertion.GetType).DeleteOnSubmit(insertion)<br />
 to work properly.  Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Unit testing an Entity Framework DAL part 1: Just hit the database by Graeme</title>
		<link>http://graemehill.ca/unit-testing-an-entity-framework-data-access-layer-part-1-just-hit-the-database/comment-page-1#comment-699</link>
		<dc:creator>Graeme</dc:creator>
		<pubDate>Tue, 22 Jun 2010 15:23:06 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=119#comment-699</guid>
		<description>zen: I acknowledged that it is technically an integration test in the article:
"it isn’t really a unit test. It is actually an integration test"
My point was that is some cases it makes more sense to only do integration tests.  Maybe I should have made it more clear in the title.

Marcus: I'm glad to see that is working well.  The only thing I would be worried about is that NHibernate may behave differently with each DBMS in some cases.  However, it the behaviour is consistent then that is probably a great solution.</description>
		<content:encoded><![CDATA[<p>zen: I acknowledged that it is technically an integration test in the article:<br />
&#8220;it isn’t really a unit test. It is actually an integration test&#8221;<br />
My point was that is some cases it makes more sense to only do integration tests.  Maybe I should have made it more clear in the title.</p>
<p>Marcus: I&#8217;m glad to see that is working well.  The only thing I would be worried about is that NHibernate may behave differently with each DBMS in some cases.  However, it the behaviour is consistent then that is probably a great solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Unit testing an Entity Framework DAL part 1: Just hit the database by Marcus Malmgren</title>
		<link>http://graemehill.ca/unit-testing-an-entity-framework-data-access-layer-part-1-just-hit-the-database/comment-page-1#comment-698</link>
		<dc:creator>Marcus Malmgren</dc:creator>
		<pubDate>Tue, 22 Jun 2010 14:59:18 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=119#comment-698</guid>
		<description>I have used an in memory database with SQLite together with NHibernate. It was extremely quick. We used the repository pattern so all the queries could be unit tested. I see what you mean about them beeing integration tests, but I don't fully agree. They test the queries (criterias in Nhibernate, could be linq) of the repositories but that doesnt mean it will work with the real DBMS. Additional integration tests against the real DBMS should also exist to guarante the functionality.</description>
		<content:encoded><![CDATA[<p>I have used an in memory database with SQLite together with NHibernate. It was extremely quick. We used the repository pattern so all the queries could be unit tested. I see what you mean about them beeing integration tests, but I don&#8217;t fully agree. They test the queries (criterias in Nhibernate, could be linq) of the repositories but that doesnt mean it will work with the real DBMS. Additional integration tests against the real DBMS should also exist to guarante the functionality.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easier PropertyChanged notification with PostSharp by Graeme</title>
		<link>http://graemehill.ca/easier-propertychanged-notification-with-postsharp/comment-page-1#comment-695</link>
		<dc:creator>Graeme</dc:creator>
		<pubDate>Sat, 19 Jun 2010 19:44:53 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=91#comment-695</guid>
		<description>Good to know.  Thanks.</description>
		<content:encoded><![CDATA[<p>Good to know.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on LINQ to SQL Gotcha #2: GetChangeSet Weirdness by A lesson on using closed source libraries &#124; Graeme Hill on .NET development</title>
		<link>http://graemehill.ca/linq-to-sql-gotcha-2-getchangeset-weirdness/comment-page-1#comment-694</link>
		<dc:creator>A lesson on using closed source libraries &#124; Graeme Hill on .NET development</dc:creator>
		<pubDate>Sat, 19 Jun 2010 19:23:59 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=206#comment-694</guid>
		<description>[...] a bug that I recently found in LINQ to SQL has made me think differrently (I wrote about the bug here). I don&#8217;t blame Microsoft for having a bug in their code since all software has bugs, but [...]</description>
		<content:encoded><![CDATA[<p>[...] a bug that I recently found in LINQ to SQL has made me think differrently (I wrote about the bug here). I don&#8217;t blame Microsoft for having a bug in their code since all software has bugs, but [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
