<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>There and Back Again : Test Driven Development</title><link>http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx</link><description>Tags: Test Driven Development</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Last Old Blog Code Update</title><link>http://blogs.msdn.com/howard_dierking/archive/2008/03/06/last-old-blog-code-update.aspx</link><pubDate>Fri, 07 Mar 2008 10:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8089513</guid><dc:creator>hdierking</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/8089513.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=8089513</wfw:commentRss><description>&lt;p&gt;Ok - after posting this update, I'll consider myself caught up with regard to picking up the pieces of my old blog.&amp;nbsp; This is the updated code sample for &lt;a href="http://blogs.msdn.com/howard_dierking/archive/2007/04/23/nhibernate-custom-mapping-types.aspx" mce_href="http://blogs.msdn.com/howard_dierking/archive/2007/04/23/nhibernate-custom-mapping-types.aspx"&gt;creating custom mapping types in NHibernate&lt;/a&gt;.&amp;nbsp; The updated sample provides a loose example of implementing the &lt;a href="http://www.ksc.com/article3.htm" mce_href="http://www.ksc.com/article3.htm"&gt;type object pattern&lt;/a&gt; - a pattern where one object instance serves as the type for a set of other object instances.&amp;nbsp; Here, for the sake of simplicity and expediency, I have designed the types such that the type object is also the value container - hopefully when you look at the code, you can see it's a pretty simple process to go a step farther and implement the full pattern.&lt;/p&gt;  &lt;p&gt;Anyway, similar to &lt;a href="http://blogs.msdn.com/howard_dierking/archive/2008/03/01/old-tdd-demo-blog-digest-and-code.aspx" mce_href="http://blogs.msdn.com/howard_dierking/archive/2008/03/01/old-tdd-demo-blog-digest-and-code.aspx"&gt;my last post&lt;/a&gt;, I've updated the code to use the &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=73818" mce_href="http://sourceforge.net/project/showfiles.php?group_id=73818"&gt;latest version of NHibernate&lt;/a&gt;, and I've added in some &lt;a href="http://msdn2.microsoft.com/en-us/magazine/cc163400.aspx" mce_href="http://msdn2.microsoft.com/en-us/magazine/cc163400.aspx"&gt;LINQ goodness&lt;/a&gt;.&amp;nbsp; And of course, all demoware disclaimers apply.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8089513" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/howard_dierking/attachment/8089513.ashx" length="2219803" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Microsoft+.NET+Programming/default.aspx">Microsoft .NET Programming</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/NHibernate/default.aspx">NHibernate</category></item><item><title>Old TDD Demo Blog - Digest and Code</title><link>http://blogs.msdn.com/howard_dierking/archive/2008/03/01/old-tdd-demo-blog-digest-and-code.aspx</link><pubDate>Sun, 02 Mar 2008 10:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7986666</guid><dc:creator>hdierking</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/7986666.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=7986666</wfw:commentRss><description>&lt;p&gt;Several of you have emailed me over the past several months asking if I had a copy of the blog text and/or code that I had mentioned in a &lt;a href="http://blogs.msdn.com/howard_dierking/archive/2006/10/29/adventures-in-tdd-ddd-and-nhibernate-from-a-past-life.aspx" mce_href="http://blogs.msdn.com/howard_dierking/archive/2006/10/29/adventures-in-tdd-ddd-and-nhibernate-from-a-past-life.aspx"&gt;much earlier blog entry&lt;/a&gt;.&amp;nbsp; As it turns out, a good friend of mine found some old archived versions of the site on an Internet cache and set them over to me.&amp;nbsp; Therefore, I have taken the web pages and compiled them into an XPS document so that you can see the thought progression that went along with building a small application, TDD style.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;Additionally, I've updated the code samples a bit.&amp;nbsp; Specifically, I've upgraded the version of &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=73818" mce_href="http://sourceforge.net/project/showfiles.php?group_id=73818"&gt;NHibernate to 1.2.1.GA&lt;/a&gt; - and as such, dropped the use of &lt;a href="http://www.ayende.com/projects/nhibernate-query-analyzer/generics.aspx" mce_href="http://www.ayende.com/projects/nhibernate-query-analyzer/generics.aspx"&gt;Ayende's NHibernate Generics library&lt;/a&gt;.&amp;nbsp; Also, as I was going through my NHibernate mappings, I realized that I had been pretty lazy with regard to semantic accuracy for collection types - I had pretty much completely used &amp;lt;bag&amp;gt; mappings instead &amp;lt;set&amp;gt; mappings for unordered collections so that I could use IList&amp;lt;T&amp;gt;.&amp;nbsp; Therefore, I cleaned that up a bit.&amp;nbsp; Other than that, the only other thing that I did was update some of the looping and conditional code to use LINQ.&lt;/p&gt;  &lt;p&gt;Finally, let me emphatically throw out the "Demoware Disclaimer" - The point of the blog and the code samples was to illustrate the thought process and corresponding code behind using TDD to &lt;b&gt;design &lt;/b&gt;a domain model.&amp;nbsp; As a result, everything else in the code is the simplest thing that could be implemented to support the overall goal - and nothing more.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7986666" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/howard_dierking/attachment/7986666.ashx" length="2480294" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Microsoft+.NET+Programming/default.aspx">Microsoft .NET Programming</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Agile/default.aspx">Agile</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/NHibernate/default.aspx">NHibernate</category></item><item><title>Wow - That Was Annoying</title><link>http://blogs.msdn.com/howard_dierking/archive/2007/11/18/wow-that-was-annoying.aspx</link><pubDate>Mon, 19 Nov 2007 05:18:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6385661</guid><dc:creator>hdierking</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/6385661.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=6385661</wfw:commentRss><description>&lt;p&gt;So I'm in an awkward place right now when it comes to programming.&amp;#xA0; In addition to the fact that I no longer program on a day-to-day basis (which is starting to bug me a little more than it used to as I'm afraid I'm starting to atrophy a bit), I'm also now up on Visual Studio 2008 - which is really great in a lot of respects - but at the same time is kind of bumming me out.&amp;#xA0; I'm not bummed because of anything inherent in Visual Studio - I'm bummed because Resharper just doesn't really work all that great in it.&amp;#xA0; Don't get me wrong - R# works - but the semantic analysis tools don't yet work with a lot of the C# 3.0 language enhancements - and as much as I tried to ignore the R# compiler errors on things like Linq queries, I finally just got tired of it an uninstalled R#, impatiently awaiting the 4.0 release.&lt;/p&gt;  &lt;p&gt;Firstly, let me just say that not having R# is miserable from a refactoring standpoint.&lt;/p&gt;  &lt;p&gt;Secondly, losing R# led me down the path to another headache (which is the subject of this post) - I no longer have a VS add-in runner for NUnit.&amp;#xA0; Yes, I know - I could (and probably should) go back and download TD.NET - but instead, I was curious to see how easily it would be for me to just convert my NUnit tests to VS 2008 unit tests.&amp;#xA0; In short, it's not terribly difficult, but getting there was a frustrating journey.&lt;/p&gt;  &lt;p&gt;Why?&amp;#xA0; Because unlike NUnit, where a test fixture is explicit in code (and only in code) via the TestFixture attribute, VS tests rely on a second piece of metadata in order to have them run via the VS test manager/test runner.&amp;#xA0; That metadata is not found in the *.vsmdi file - instead, it's actually a property in the project file of your unit test project.&lt;/p&gt;  &lt;p&gt;Therefore, if you started from a regular class library project and need to have it recognized by VS as a &amp;quot;test project&amp;quot;, open the *.csproj file in notepad and add the following to any PropertyGroup.&lt;/p&gt;  &lt;p&gt;&amp;lt;ProjectTypeGuids&amp;gt;{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&amp;lt;/ProjectTypeGuids&amp;gt;&lt;/p&gt;  &lt;p&gt;The first Guid identifies your project as a test project (the second is the language I believe - feel free to correct me if I'm wrong).&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6385661" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Microsoft+.NET+Programming/default.aspx">Microsoft .NET Programming</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Agile/default.aspx">Agile</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/My+Toolbox/default.aspx">My Toolbox</category></item><item><title>Linq-i-fying My Existing Projects - Part 1</title><link>http://blogs.msdn.com/howard_dierking/archive/2007/11/14/linq-i-fying-my-existing-projects-part-1.aspx</link><pubDate>Wed, 14 Nov 2007 19:09:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6215100</guid><dc:creator>hdierking</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/6215100.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=6215100</wfw:commentRss><description>&lt;p&gt;To be honest, I don't know how many parts there will end up being - since the longer I'm away from day to day developing, the fewer projects I have to go back through.&amp;#xA0; However, I can think of a few more off the top of my head - so I still think that &amp;quot;Part n&amp;quot; is a fair statement.&lt;/p&gt;  &lt;p&gt;Anyway, for a sample golfing application, I have the following hierarchy (fragment).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/howard_dierking/WindowsLiveWriter/LinqifyingMyExistingProjectsPart1_7265/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="142" alt="image" src="http://blogs.msdn.com/blogfiles/howard_dierking/WindowsLiveWriter/LinqifyingMyExistingProjectsPart1_7265/image_thumb_1.png" width="405" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, ignoring for the moment the fact that I didn't make Round a generic and thereby avoid the need for it, the following method in Round validates that either Players or Teams can play a round of golf, but not a mixture of both (e.g. - a single player cannot go up against a team).&lt;/p&gt;  &lt;div&gt;private void ValidatePlayerTypeConsistency(Player[] players) { &lt;/div&gt;  &lt;div&gt;&amp;#xA0; foreach (Player player in players) { &lt;/div&gt;  &lt;div&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; if (!player.GetType().Equals(_expectedPlayerType)) &lt;/div&gt;  &lt;div&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; throw new ArgumentException(&amp;quot;Player was not of the expected type ('&amp;quot; + &lt;/div&gt;  &lt;div&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; _expectedPlayerType.FullName + &amp;quot;')&amp;quot;); &lt;/div&gt;  &lt;div&gt;&amp;#xA0; } &lt;/div&gt;  &lt;div&gt;}&lt;/div&gt;  &lt;p&gt;Using a C# 3.0 Linq query, the imperative structure of the foreach loop can now be replaced with a more declarative one as follows.&lt;/p&gt;  &lt;div&gt;private void ValidatePlayerTypeConsistency(Player[] players) { &lt;/div&gt;  &lt;div&gt;&amp;#xA0; bool hasUnexpectedPlayers = (from p in players select p)&lt;/div&gt;  &lt;div&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; .Any(p =&amp;gt; !p.GetType().Equals(_expectedPlayerType)); &lt;/div&gt;  &lt;div&gt;&amp;#xA0;&lt;/div&gt;  &lt;div&gt;if(hasUnexpectedPlayers) &lt;/div&gt;  &lt;div&gt;&amp;#xA0; throw new ArgumentException(&amp;quot;Player was not of the expected type ('&amp;quot; + &lt;/div&gt;  &lt;div&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0; _expectedPlayerType.FullName + &amp;quot;')&amp;quot;); &lt;/div&gt;  &lt;div&gt;}&lt;/div&gt;  &lt;p&gt;A couple of quick things to notice here:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;In the Linq query, the C# 3.0 language extensions do not cover the entire breadth of Linq functionality (e.g. - the &amp;quot;Any&amp;quot; quantifier).&amp;#xA0; When you run into cases like this, remember that it is perfectly acceptable to mix the language extensions syntax with the standard extension method/lambda syntax.&amp;#xA0; You can do this by simply enclosing the language extensions syntax block in parentheses and then calling additional methods on the result. &lt;/li&gt;    &lt;li&gt;My Linq query syntax didn't really reduce my total line count and the declarative syntax is arguably harder to read.&amp;#xA0; To this, I can only say a) this is a really simple example and b) like anonymous delegates and generics, you get used to it.&amp;#xA0; That said, this example should illustrate that you should take a pragmatic approach to incorporating new features like Linq into your applications. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;A final note here - I am ONLY able to do this type of code replacement because I have a great set of unit tests backing me up.&amp;#xA0; In fact, when I first tried out the Linq approach, my test failed.&amp;#xA0; DO NOT make changes like this to working applications without having good tests to back you up.&lt;/p&gt;  &lt;p&gt;Hopefully, I'll bring you some more complex examples soon.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6215100" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Microsoft+.NET+Programming/default.aspx">Microsoft .NET Programming</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>ALT.NET - Trip Report</title><link>http://blogs.msdn.com/howard_dierking/archive/2007/10/18/alt-net-trip-report.aspx</link><pubDate>Fri, 19 Oct 2007 06:41:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5517391</guid><dc:creator>hdierking</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/5517391.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=5517391</wfw:commentRss><description>&lt;p&gt;I had the recent opportunity to travel to Austin, TX to attend a meeting of the minds of &lt;a href="http://altnetconf.com/participants"&gt;those who are considered thought leaders&lt;/a&gt; in the .NET agile/open source space.&amp;nbsp; This community, in somewhat of an expression of feeling that the general .NET community (as guided by Microsoft) has gone in a different philosophical direction with regard to designing and building software, has aptly elected the name &lt;a href="http://altdotnet.org/"&gt;ALT.NET&lt;/a&gt;.&amp;nbsp; While the meaning of "ALT" was the subject of several spirited debates, my general takeaway is that "ALT" is simply shorthand for "alternatives".&amp;nbsp; The plural is important here because this community is not defining themselves or their values as &lt;strong&gt;the&lt;/strong&gt; alternative to Microsoft technology and guidance.&amp;nbsp; Rather, at the core, they are more interested in trying to promote the development of leaner, more maintainable software using whatever tools are most helpful to those ends (Microsoft or otherwise).&amp;nbsp; To give you an idea of just how big this community's toolbox is, &lt;a href="http://www.flickr.com/photos/palermo/1510489438/in/pool-altnetconf/"&gt;see the following&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Frankly, I think that the choice of the "ALT" moniker, while not meant to be seen as an alternative to Microsoft (which would actually be contradicted by the ".NET" part), is born out of the general frustration by the community that the tools Microsoft gives developers enables short term productivity and long term headaches - while at the same time decreasing the overall skill of developers and making them dependent on a specific type of tool (e.g. - designers).&lt;/p&gt; &lt;p&gt;The conference was conducted in a format called "&lt;a href="http://altnetconf.com/home/open_spaces"&gt;Open Space&lt;/a&gt;".&amp;nbsp; In this style, there were no formal sessions and no formal presenters.&amp;nbsp; Anybody who wanted to talk about (not necessarily lead) any subject could put it forward to the group and schedule it for a time slot/meeting room.&amp;nbsp; As such, &lt;a href="http://simonguest.com/blogs/smguest/default.aspx"&gt;Simon Guest&lt;/a&gt; and I sponsored a talk on how to engage the ALT.NET community with the rest of the .NET developer community.&amp;nbsp; From those individuals who attended the session, we were able to identify a few interesting points of feedback.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The community feels that MSDN and MSDN Magazine are stale and sterile, and that while there are lots of "how-to" articles, there is very little content that explains "why".  &lt;li&gt;There was a general lack of awareness about newer offerings from MSDN online - particularly the architecture dev center.  &lt;li&gt;Many of the audience are already avid and well-followed bloggers, and as such were skeptical as to the value-proposition of writing for MSDN Magazine.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;As to the first 2 points, I think that there is a lot we can do as an organization to incorporate many of the ideas expressed at the ALT.NET conference - for &lt;a href="http://msdn.microsoft.com/msdnmag/"&gt;MSDN Magazine&lt;/a&gt;, the first obvious step is to get more people from this community to write for the magazine - which leads me to the third bullet.&amp;nbsp; The point that I kept reiterating to the participants was that while things like blogging and holding ALT.NET conferences are great, they're an echo chamber.&amp;nbsp; People who visit ALT.NET blogs are generally going there because they have already bought into at least some of the philosophy.&amp;nbsp; If you want to really affect change in the larger community, you need go to the community - and MSDN/MSDN Magazine are 2 fantastic ways to go about it.&amp;nbsp; I think that this message resonated well, as, since returning, I have received several article submissions from conference participants.&lt;/p&gt; &lt;p&gt;In sum, this is a community that really wants to see people develop better software, and it was very encouraging to see Microsoft recognizing their contribution to the community by way of the number of &lt;a href="http://altnetconf.com/participants"&gt;Redmond folks in attendance&lt;/a&gt;.&amp;nbsp; Going forward, it will be exciting to see both how this community evolves - and how their values and practices have an impact on the larger development community.&lt;/p&gt; &lt;p&gt;If you want to know more about the conference, such as the specific sessions/topics, I covered each day of the conference on my blog - so see the following.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/howard_dierking/archive/2007/10/05/alt-net-conference-opening-day-opening-thoughts.aspx"&gt;Day 1&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/howard_dierking/archive/2007/10/06/alt-net-conference-day-2-taking-the-good-with-the-bad.aspx"&gt;Day 2&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/howard_dierking/archive/2007/10/18/alt-net-day-3.aspx"&gt;Day 3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://www.flickr.com/groups/altnetconf/pool/"&gt;Click here for pictures&lt;/a&gt; from the conference.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5517391" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Agile/default.aspx">Agile</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/MSDN+Magazine/default.aspx">MSDN Magazine</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/ALTNETCONF/default.aspx">ALTNETCONF</category></item><item><title>Scrum Room?</title><link>http://blogs.msdn.com/howard_dierking/archive/2007/04/10/scrum-room.aspx</link><pubDate>Wed, 11 Apr 2007 08:56:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2082271</guid><dc:creator>hdierking</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/2082271.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=2082271</wfw:commentRss><description>&lt;p&gt;If you're going to do any job, you may as well &lt;a href="http://weblogs.asp.net/bsimser/archive/2007/04/03/scrum-room-fun-room.aspx"&gt;have some fun with it&lt;/a&gt;.  Great work Bil!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2082271" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Agile/default.aspx">Agile</category></item><item><title>Microsoft Acquires TeamPlain – Free to TFS Customers!</title><link>http://blogs.msdn.com/howard_dierking/archive/2007/03/27/microsoft-acquires-teamplain-free-to-tfs-customers.aspx</link><pubDate>Tue, 27 Mar 2007 21:18:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1966434</guid><dc:creator>hdierking</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/1966434.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=1966434</wfw:commentRss><description>&lt;p&gt;This is a really awesome deal for current Microsoft Team Foundation Server customers.  Check out the &lt;a href="http://blogs.msdn.com/robcaron/archive/2007/03/26/1952943.aspx"&gt;entry on Rob Caron's blog&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1966434" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Microsoft+.NET+Programming/default.aspx">Microsoft .NET Programming</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Visual+Studio+Team+System/default.aspx">Visual Studio Team System</category></item><item><title>Team System Unit Tests and Deployment Items</title><link>http://blogs.msdn.com/howard_dierking/archive/2007/02/24/team-system-unit-tests-and-deployment-items.aspx</link><pubDate>Sun, 25 Feb 2007 02:24:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1754599</guid><dc:creator>hdierking</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/howard_dierking/comments/1754599.aspx</comments><wfw:commentRss>http://blogs.msdn.com/howard_dierking/commentrss.aspx?PostID=1754599</wfw:commentRss><description>&lt;p&gt;Just a quick tip in case you haven't yet encountered this yet. In the course of my development rhythm, I use both &lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/aa718823.aspx"&gt;Visual Studio Team Edition for Software Testers&lt;/a&gt; and &lt;a href="http://www.testdriven.net/"&gt;TestDriven.Net&lt;/a&gt; as test harnesses for my unit tests. This is primarily due to speed. As I'm sure you're aware, the VSTE test engine takes a good bit longer to initialize than TD.NET and because my programming style is very &lt;a href="http://en.wikipedia.org/wiki/Test_driven_development"&gt;TDD&lt;/a&gt; in nature, I like to run my tests more frequently, and from the test code itself. Now, I ran into a situation today where I wanted to do some testing on an Xml schema that I wrote. Therefore, I have the following test.&lt;/p&gt; &lt;div class="csharpcode"&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;[WorkItem(93), TestMethod]    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; testGetAssetTypeSchema() {    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    XmlSchema assetTypeSchema = &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;      ((IXmlSerializable) &lt;span class="kwrd"&gt;new&lt;/span&gt; AssetType(&lt;span class="str"&gt;"temp"&lt;/span&gt;)).GetSchema();    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    XmlReaderSettings xmlSettings = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlReaderSettings();    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    xmlSettings.CloseInput = &lt;span class="kwrd"&gt;true&lt;/span&gt;;    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    xmlSettings.IgnoreComments = &lt;span class="kwrd"&gt;true&lt;/span&gt;;    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    xmlSettings.IgnoreWhitespace = &lt;span class="kwrd"&gt;true&lt;/span&gt;;    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    xmlSettings.Schemas.Add(assetTypeSchema);   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    xmlSettings.ValidationFlags = &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;      XmlSchemaValidationFlags.ProcessIdentityConstraints;   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    xmlSettings.ValidationType = ValidationType.Schema;   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    xmlSettings.ValidationEventHandler += &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;      &lt;span class="kwrd"&gt;new&lt;/span&gt; ValidationEventHandler(settings_ValidationEventHandler);   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    XmlReader xrdr = XmlReader.Create(&lt;span class="str"&gt;"Workstation.xml"&lt;/span&gt;, xmlSettings);   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    XmlDocument xdoc = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlDocument();   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    xdoc.Load(xrdr);   &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;My "Workstation.xml" file sits in the project directory along with everything all of the rest of my code files. I run my test using TD.NET and I get a file IO exception – my Xml file could not be located. Oh – woops! I forgot to change the "Copy to Output Directory" property. This ensures that when I build my project, the Xml file will always get copied into the output directory along with my assemblies. To do this, I select my Xml file in the solution explorer, and look at the properties window. I can then find the "Copy to Output Directory" setting and change it to "Copy always". &lt;/p&gt;
&lt;p&gt;Now, at this point, my test will run just fine with TD.NET because that test harness runs my tests "in place". However, VSTE creates an entirely different folder structure to manage test runs and test results. Therefore, when I run my test with VSTE, my test fails again. To correct the problem, I need to add one more attribute.&lt;/p&gt;&lt;pre class="csharpcode"&gt;[WorkItem(93), DeploymentItem(&lt;span class="str"&gt;"Workstation.xml"&lt;/span&gt;), TestMethod] 
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; testGetAssetTypeSchema() { ... }&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;The "DeploymentItemAttribute" will cause the VSTE test engine to copy my Xml file from the assembly output folder to the test deployment folder – and therefore the relative path I specify in my test still works flawlessly.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1754599" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Microsoft+.NET+Programming/default.aspx">Microsoft .NET Programming</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Test+Driven+Development/default.aspx">Test Driven Development</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Visual+Studio+Team+System/default.aspx">Visual Studio Team System</category><category domain="http://blogs.msdn.com/howard_dierking/archive/tags/Agile/default.aspx">Agile</category></item></channel></rss>