<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>wf Wiki Rss Feed</title><link>http://wf.codeplex.com/wikipage</link><description>wf Wiki Rss Description</description><item><title>New Comment on "Install Clean Project"</title><link>http://wf.codeplex.com/wikipage?title=Install Clean Project&amp;ANCHOR#C26461</link><description>On a Windows Server 2008 R2 machine this did not work.  The installer completed but the VS External Tools entry was not added.  On a hunch I reinstalled it starting from an Administrator Command Prompt.  It then worked.  Perhaps the installer could request Administrator elevation to avoid this&amp;#63;</description><author>MikeHoney</author><pubDate>Thu, 07 Feb 2013 23:27:38 GMT</pubDate><guid isPermaLink="false">New Comment on "Install Clean Project" 20130207112738P</guid></item><item><title>New Comment on "HttpWorkflowServiceHost"</title><link>http://wf.codeplex.com/wikipage?title=HttpWorkflowServiceHost&amp;ANCHOR#C25679</link><description>Please go ahead with this HttpWorkflowServiceHost it would be very great to have finally the possibility to invoke a WorkflowService via HTTP GET. This would really enhance WorkflowServices.</description><author>schleicherx</author><pubDate>Fri, 23 Nov 2012 14:51:31 GMT</pubDate><guid isPermaLink="false">New Comment on "HttpWorkflowServiceHost" 20121123025131P</guid></item><item><title>New Comment on "How do I install Microsoft.Activities?"</title><link>http://wf.codeplex.com/wikipage?title=How do I install Microsoft.Activities?&amp;ANCHOR#C25649</link><description>When will this be updated top support WF 4.5&amp;#63;</description><author>mtod</author><pubDate>Tue, 20 Nov 2012 19:36:47 GMT</pubDate><guid isPermaLink="false">New Comment on "How do I install Microsoft.Activities?" 20121120073647P</guid></item><item><title>New Comment on "Install Clean Project"</title><link>http://wf.codeplex.com/wikipage?title=Install Clean Project&amp;ANCHOR#C25585</link><description>Thanks&amp;#59; you may not want to hear this &amp;#40;I know this is anathema to many coders&amp;#41; but I&amp;#39;m going to use this as a &amp;#34;poor man&amp;#39;s backup utility&amp;#34;&amp;#59; create a zip of the pertinent files and store it on a usb stick&amp;#59; when I need to compare this file with that, I&amp;#39;ll use WinMerge to do so.</description><author>BClayShannon</author><pubDate>Wed, 14 Nov 2012 15:33:07 GMT</pubDate><guid isPermaLink="false">New Comment on "Install Clean Project" 20121114033307P</guid></item><item><title>New Comment on "WebApiWorkflow"</title><link>http://wf.codeplex.com/wikipage?title=WebApiWorkflow&amp;ANCHOR#C25118</link><description>Any news on when we might see this&amp;#63;</description><author>oatkins</author><pubDate>Fri, 28 Sep 2012 01:41:25 GMT</pubDate><guid isPermaLink="false">New Comment on "WebApiWorkflow" 20120928014125A</guid></item><item><title>New Comment on "Microsoft.Activities.StateMachine"</title><link>http://wf.codeplex.com/wikipage?title=Microsoft.Activities.StateMachine&amp;ANCHOR#C24822</link><description>Hi Ron, I would like to use WF for test automation. Is there any progress in the coded statemachine thread&amp;#63;&amp;#10;Thank you.&amp;#10;Roi</description><author>YoYoRnd</author><pubDate>Mon, 27 Aug 2012 10:26:02 GMT</pubDate><guid isPermaLink="false">New Comment on "Microsoft.Activities.StateMachine" 20120827102602A</guid></item><item><title>New Comment on "Which release should I install?"</title><link>http://wf.codeplex.com/wikipage?title=Which release should I install?&amp;ANCHOR#C24797</link><description>Warning. If you compile against the 4.5 release in your project, and you don&amp;#39;t have the .NET 4.5 Framework installed at runtime, your program will eventually fail with the following exception&amp;#58; System.TypeLoadException&amp;#58; Could not load type &amp;#39;System.Runtime.CompilerServices.ExtensionAttribute&amp;#39; from assembly &amp;#39;mscorlib, Version&amp;#61;4.0.0.0, Culture&amp;#61;neutral, PublicKeyToken&amp;#61;b77a5c561934e089&amp;#39;. This is because .NET 4.5 makes subtle breaking changes to the framework. If you&amp;#39;re going to run on a machine with .NET 4.0 - save yourself a couple days of frustration - DO NOT compile against version 4.5 of this &amp;#40;or any other&amp;#41; library. Ouch&amp;#33;</description><author>Suncat2000</author><pubDate>Thu, 23 Aug 2012 16:53:24 GMT</pubDate><guid isPermaLink="false">New Comment on "Which release should I install?" 20120823045324P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://wf.codeplex.com/documentation?version=20</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;Microsoft.Activities.* Documentation&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Microsoft.Activities%20Overview&amp;referringTitle=Documentation"&gt;Microsoft.Activities.Extensions Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Microsoft.Activities.UnitTesting%20Overview&amp;referringTitle=Documentation"&gt;Microsoft.Activities.UnitTesting Overview&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Clean Project Tool&lt;/h2&gt;Clean Project is a utility that cleans Visual Studio project directories so you can quickly upload or email a zip file with your solution.
&lt;ul&gt;&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Clean%20Project%20Overview&amp;referringTitle=Documentation"&gt;Clean Project Overview&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Microsoft.Activities.StateMachine Prototype Project&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Microsoft.Activities.StateMachine&amp;referringTitle=Documentation"&gt;Microsoft.Activities.StateMachine&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Learning WF&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Beginner&amp;referringTitle=Documentation"&gt;Beginner&lt;/a&gt; - Authoring XAML workflows and workflow services with Visual Studio&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Intermediate&amp;referringTitle=Documentation"&gt;Intermediate&lt;/a&gt; - Authoring CodeActivity, Bookmarks and WorkflowApplication, UnitTesting&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Advanced&amp;referringTitle=Documentation"&gt;Advanced&lt;/a&gt; - Native Activities, Extensions, Designers&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Versioning&lt;/h2&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=How%20projects%20are%20versioned&amp;referringTitle=Documentation"&gt;How projects are versioned&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;WF Migration Kit Documentation&lt;/h2&gt;User Guide Samples and Tutorials are included in the release &lt;a href="http://wf.codeplex.com/releases/view/41401"&gt;WF Migration Kit CTP 2&lt;/a&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Thu, 19 Jul 2012 15:46:10 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20120719034610P</guid></item><item><title>New Comment on "Tracking states with WorkflowApplication"</title><link>http://wf.codeplex.com/wikipage?title=Tracking states with WorkflowApplication&amp;ANCHOR#C24397</link><description>How can I access variables declared in state machine &amp;#40;or workflow&amp;#41;&amp;#38;&amp;#10;Thanx in advance.</description><author>Norritt</author><pubDate>Mon, 16 Jul 2012 11:35:45 GMT</pubDate><guid isPermaLink="false">New Comment on "Tracking states with WorkflowApplication" 20120716113545A</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=11</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestDatabase&lt;br /&gt;&lt;a href="http://www.codeplex.com/Download?ProjectName=wf&amp;DownloadId=444486"&gt;Download Script&lt;/a&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestDatabase%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;IS&lt;/span&gt; &lt;span style="color:Blue;"&gt;NULL&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;RAISERROR&lt;/span&gt; (N&lt;span style="color:#A31515;"&gt;&amp;#39;No database to drop&amp;#39;&lt;/span&gt;, 1, 1) &lt;span style="color:Blue;"&gt;WITH&lt;/span&gt; NOWAIT
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Thu, 12 Jul 2012 17:29:57 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120712052957P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=10</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestDatabase&lt;br /&gt;&lt;span class="unresolved"&gt;Cannot resolve file macro, invalid file name or id.&lt;/span&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestDatabase%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;IS&lt;/span&gt; &lt;span style="color:Blue;"&gt;NULL&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;RAISERROR&lt;/span&gt; (N&lt;span style="color:#A31515;"&gt;&amp;#39;No database to drop&amp;#39;&lt;/span&gt;, 1, 1) &lt;span style="color:Blue;"&gt;WITH&lt;/span&gt; NOWAIT
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Thu, 12 Jul 2012 17:29:38 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120712052938P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=9</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestDatabase&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestDatabase%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;IS&lt;/span&gt; &lt;span style="color:Blue;"&gt;NULL&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;RAISERROR&lt;/span&gt; (N&lt;span style="color:#A31515;"&gt;&amp;#39;No database to drop&amp;#39;&lt;/span&gt;, 1, 1) &lt;span style="color:Blue;"&gt;WITH&lt;/span&gt; NOWAIT
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Thu, 12 Jul 2012 17:27:14 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120712052714P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=8</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestDatabase&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestDatabase%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;IS&lt;/span&gt; &lt;span style="color:Blue;"&gt;NULL&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;RAISERROR&lt;/span&gt; (N&lt;span style="color:#A31515;"&gt;&amp;#39;No database to drop&amp;#39;&lt;/span&gt;, 1, 1) &lt;span style="color:Blue;"&gt;WITH&lt;/span&gt; NOWAIT
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Thu, 12 Jul 2012 17:26:45 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120712052645P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=7</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestInstanceStore&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;) = &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestDatabase%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;IS&lt;/span&gt; &lt;span style="color:Blue;"&gt;NULL&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;RAISERROR&lt;/span&gt; (N&lt;span style="color:#A31515;"&gt;&amp;#39;No database to drop&amp;#39;&lt;/span&gt;, 1, 1) &lt;span style="color:Blue;"&gt;WITH&lt;/span&gt; NOWAIT
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Thu, 12 Jul 2012 17:26:24 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120712052624P</guid></item><item><title>Updated Wiki: How do I test with WorkflowServiceTestHost?</title><link>http://wf.codeplex.com/wikipage?title=How do I test with WorkflowServiceTestHost?&amp;version=4</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;How do I test with WorkflowServiceTestHost?&lt;/h1&gt;Notes:
&lt;ul&gt;&lt;li&gt;&lt;i&gt;In this test you will be self hosting a WCF Service using named pipes&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;This test code requires Microsoft.Activities and Microsoft.Activities.UnitTesting &amp;gt;= v2.0.2 &lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/MicrosoftActivitiesUnitTest-165a3e84"&gt;Download the sample code&lt;/a&gt; for this walkthrough from MSDN Code Gallery&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;Task 1 - Create the Workflow Service Library&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Create a new Project using the &lt;b&gt;Workflow / WCF Workflow Service Application&lt;/b&gt; project template named MathServiceLibrary&lt;/li&gt;
&lt;li&gt;Open Service1.xamlx in the Workflow Designer&lt;/li&gt;
&lt;li&gt;In the ReceiveRequest activity change the operation name to &lt;b&gt;Increment&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Drop an &lt;b&gt;Assign&lt;/b&gt; activity below the ReceiveRequest and set the properties - we will intentionally cause a bug by adding 2 to the data&lt;/li&gt;&lt;/ul&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt; To &lt;/td&gt;&lt;td&gt; &lt;b&gt;result&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Value &lt;/td&gt;&lt;td&gt; &lt;b&gt;data + 2&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;ul&gt;&lt;li&gt;In the SendResponse activity open the message content and set it to &lt;b&gt;data&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Rename &lt;b&gt;Service1.xamlx&lt;/b&gt; to &lt;b&gt;IncrementService.xamlx&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Set the WorkflowService properties&lt;/li&gt;&lt;/ul&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt; ConfigurationName &lt;/td&gt;&lt;td&gt; &lt;b&gt;IncrementService&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Name &lt;/td&gt;&lt;td&gt; &lt;b&gt;IncrementService&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;img src="http://i3.codeplex.com/Download?ProjectName=wf&amp;DownloadId=305881" alt="IncrementService.png" title="IncrementService.png" /&gt;
&lt;h3&gt;Task 2 - Create the Test Project&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Right click on the solution and select Add New Project...&lt;/li&gt;
&lt;li&gt;Select Test / Test Project&lt;/li&gt;
&lt;li&gt;Name the project &lt;b&gt;MathServiceLibrary.Tests&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Rename &lt;b&gt;UnitTest1&lt;/b&gt; (class and file) to &lt;b&gt;IncrementServiceTest&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Add a Service Reference to IncrementService.xamlx with the namespace &lt;b&gt;IncrementService&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wf.codeplex.com/wikipage?title=Install%20Microsoft.Activities.UnitTesting%3f&amp;referringTitle=How%20do%20I%20test%20with%20WorkflowServiceTestHost%3f"&gt;Use NuGet to Install&lt;/a&gt; Microsoft.Activities.UnitTesting to &lt;b&gt;MathServiceLibrary.Tests&lt;/b&gt; &lt;/li&gt;
&lt;li&gt;Open &lt;b&gt;Solution Items / Local.testsettings&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;In the Deployment tab select &lt;b&gt;Enable Deployment&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;b&gt;Apply&lt;/b&gt; and &lt;b&gt;Close&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Open IncrementServiceTest.cs and add the following namespace directives&lt;/li&gt;&lt;/ul&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; System.ServiceModel;
&lt;span style="color:Blue;"&gt;using&lt;/span&gt; Microsoft.Activities.UnitTesting;
&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Implement the unit test&lt;/li&gt;&lt;/ul&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Gray;"&gt;///&lt;/span&gt; &lt;span style="color:Gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:Gray;"&gt;///&lt;/span&gt;&lt;span style="color:Green;"&gt; The increment service should increment data.&lt;/span&gt;
&lt;span style="color:Gray;"&gt;///&lt;/span&gt; &lt;span style="color:Gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:Gray;"&gt;///&lt;/span&gt; &lt;span style="color:Gray;"&gt;&amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;span style="color:Green;"&gt;// You must deploy the XAMLX file to the test directory&amp;lt;/remarks&amp;gt;&lt;/span&gt;
[TestMethod]
[DeploymentItem(&lt;span style="color:#A31515;"&gt;@&amp;quot;%LABDIR%\Microsoft.Activities.UnitTesting\Examples\MathServiceLibrary\MathServiceLibrary\IncrementService.xamlx&amp;quot;&lt;/span&gt;)]
&lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; IncrementServiceShouldIncrementData()
{
    &lt;span style="color:Green;"&gt;// Arrange&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;int&lt;/span&gt; InitialData = 1;
    &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;int&lt;/span&gt; ExpectedData = 2;

    WorkflowServiceTestHost host = &lt;span style="color:Blue;"&gt;null&lt;/span&gt;;
    &lt;span style="color:Blue;"&gt;try&lt;/span&gt;
    {
        &lt;span style="color:Blue;"&gt;using&lt;/span&gt; (host = WorkflowServiceTestHost.Open(&lt;span style="color:#A31515;"&gt;&amp;quot;IncrementService.xamlx&amp;quot;&lt;/span&gt;, ServiceAddress))
        {
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; proxy = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; ServiceClient(Binding, ServiceAddress);
            &lt;span style="color:Blue;"&gt;int&lt;/span&gt;? value = InitialData;
            proxy.Increment(&lt;span style="color:Blue;"&gt;ref&lt;/span&gt; value);
            Assert.AreEqual(ExpectedData, value, &lt;span style="color:#A31515;"&gt;&amp;quot;Increment did not correctly increment the value&amp;quot;&lt;/span&gt;);
        }

        &lt;span style="color:Green;"&gt;// The host must be closed before asserting tracking&lt;/span&gt;
        &lt;span style="color:Green;"&gt;// Explicitly call host.Close or exit the using block to do this.&lt;/span&gt;

        &lt;span style="color:Green;"&gt;// Assert that the Assign activity was executed with an argument named &amp;quot;Value&amp;quot; which contains the value 2&lt;/span&gt;
        host.Tracking.Assert.ExistsArgValue(&lt;span style="color:#A31515;"&gt;&amp;quot;Assign&amp;quot;&lt;/span&gt;, ActivityInstanceState.Closed, &lt;span style="color:#A31515;"&gt;&amp;quot;Value&amp;quot;&lt;/span&gt;, 2);
    }
    &lt;span style="color:Blue;"&gt;finally&lt;/span&gt;
    {
        &lt;span style="color:Blue;"&gt;if&lt;/span&gt; (host != &lt;span style="color:Blue;"&gt;null&lt;/span&gt;)
        {
            host.Tracking.Trace();
        }
    }
}
&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Task 3 - Run the Test and Diagnose Failure&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Run the test, it will fail&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
Assert.AreEqual failed. Expected:&amp;lt;2&amp;gt;. Actual:&amp;lt;3&amp;gt;. Increment did not correctly increment the value
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Open the test results and look at the tracking data&lt;/li&gt;&lt;/ul&gt;
&lt;h4&gt;Did the service receive the correct initial value?&lt;/h4&gt;Tracking record 11 shows the message that was received and the value &lt;b&gt;1&lt;/b&gt; is in the message body&lt;br /&gt;&lt;pre&gt;
11: Activity [14.6] &amp;quot;InternalReceiveMessage&amp;quot; is Closed at 01:42:03.5879
{
    Arguments
        CorrelatesWith: 
        Message: &amp;lt;s:Envelope xmlns:a=&amp;quot;http://www.w3.org/2005/08/addressing&amp;quot; xmlns:s=&amp;quot;http://www.w3.org/2003/05/soap-envelope&amp;quot;&amp;gt;
  &amp;lt;s:Header&amp;gt;
    &amp;lt;a:Action s:mustUnderstand=&amp;quot;1&amp;quot;&amp;gt;http://tempuri.org/IService/Increment&amp;lt;/a:Action&amp;gt;
    &amp;lt;a:MessageID&amp;gt;urn:uuid:bd4d84b7-0677-446e-885c-40e689088e8a&amp;lt;/a:MessageID&amp;gt;
    &amp;lt;a:ReplyTo&amp;gt;
      &amp;lt;a:Address&amp;gt;http://www.w3.org/2005/08/addressing/anonymous&amp;lt;/a:Address&amp;gt;
    &amp;lt;/a:ReplyTo&amp;gt;
    &amp;lt;a:To s:mustUnderstand=&amp;quot;1&amp;quot;&amp;gt;net.pipe://localhost/IncrementService&amp;lt;/a:To&amp;gt;
  &amp;lt;/s:Header&amp;gt;
  &amp;lt;s:Body&amp;gt;
    &amp;lt;int xmlns=&amp;quot;http://schemas.microsoft.com/2003/10/Serialization/&amp;quot;&amp;gt;1&amp;lt;/int&amp;gt;
  &amp;lt;/s:Body&amp;gt;
&amp;lt;/s:Envelope&amp;gt;
        noPersistHandle: System.Activities.NoPersistHandle
        Parameter0: System.ServiceModel.Activities.CorrelationHandle
}
&lt;/pre&gt;
&lt;h4&gt;Did the Assign activity assign the correct value?&lt;/h4&gt;Tracking record 18 shows that the assign activity received the value &lt;b&gt;3&lt;/b&gt; from the expression which is incorrect.&lt;br /&gt;&lt;pre&gt;
18: Activity [9] &amp;quot;Assign&amp;quot; is Executing at 01:42:03.5879
{
    Arguments
        Value: 3
}
&lt;/pre&gt;&lt;br /&gt;
&lt;h3&gt;Task 4 - Correct the Workflow Service&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Open IncrementService.xamlx and set the correct the expression on the assign activity &lt;b&gt;data + 1&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Run the test again, it will pass &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Sat, 30 Jun 2012 20:39:33 GMT</pubDate><guid isPermaLink="false">Updated Wiki: How do I test with WorkflowServiceTestHost? 20120630083933P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=6</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestInstanceStore&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestInstanceStore%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames) = 1
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;no databases to drop&amp;#39;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Sat, 30 Jun 2012 17:24:10 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120630052410P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=5</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestInstanceStore&lt;br /&gt;&lt;span class="unresolved"&gt;Cannot resolve file macro, invalid file name or id.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestInstanceStore%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames) = 1
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;no databases to drop&amp;#39;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Sat, 30 Jun 2012 17:23:50 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120630052350P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=4</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestInstanceStore&lt;br /&gt;&lt;span class="unresolved"&gt;Cannot resolve file macro, invalid file name or id.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestInstanceStore%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames) = 1
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;no databases to drop&amp;#39;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Sat, 30 Jun 2012 17:23:35 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120630052335P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestInstanceStore&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestInstanceStore%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames) = 1
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;no databases to drop&amp;#39;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Sat, 30 Jun 2012 17:22:47 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120630052247P</guid></item><item><title>Updated Wiki: What are some tips for unit testing with a database?</title><link>http://wf.codeplex.com/wikipage?title=What are some tips for unit testing with a database?&amp;version=2</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;What are some tips for testing with a SQL database?&lt;/h2&gt;
&lt;h3&gt;Don&amp;#39;t do it&lt;/h3&gt;You probably shouldn&amp;#39;t use a SQL database when doing unit tests if you don&amp;#39;t have to.  We provide MemoryStore which is an in-memory instance store that works for most things.&lt;br /&gt;However, there are cases where MemoryStore is not sufficient.  For example, if you want to use LoadRunnableInstance, MemoryStore does not support this command.  Or, you may want to test a PersistenceParticipant, PersistenceIOParticipant or Promoted Properties with SqlWorkflowInstanceStore.&lt;br /&gt;
&lt;h3&gt;Always start your test with a clean database.  &lt;/h3&gt;This means you should create a new database prior to running each test.  Yes this will make it slower but you need to start the test from a known state.  &lt;br /&gt;
&lt;h3&gt;Drop the database after the test is over&lt;/h3&gt;You may want to keep the database if the test failed for some reason, but over time your build servers will likely fill up with unwanted databases.&lt;br /&gt;
&lt;h3&gt;Use a unique name for the database.  &lt;/h3&gt;Your test may be running concurrently with other tests.  Using a unique name ensures that the tests won&amp;#39;t interfere with each other.  Use a prefix for the name so you can tell what your test databases are and you can write a script to remove all test databases that start with the prefix.&lt;br /&gt;&lt;br /&gt;In this script I drop all the databases that start with TestInstanceStore&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;use&lt;/span&gt; master
go
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @dbnames &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;declare&lt;/span&gt; @statement &lt;span style="color:Blue;"&gt;nvarchar&lt;/span&gt;(&lt;span style="color:Magenta;"&gt;max&lt;/span&gt;)
&lt;span style="color:Blue;"&gt;select&lt;/span&gt; @dbnames = @dbnames + &lt;span style="color:#A31515;"&gt;&amp;#39;,[&amp;#39;&lt;/span&gt; + &lt;span style="color:Blue;"&gt;name&lt;/span&gt; + &lt;span style="color:#A31515;"&gt;&amp;#39;]&amp;#39;&lt;/span&gt; &lt;span style="color:Blue;"&gt;from&lt;/span&gt; sys.databases &lt;span style="color:Blue;"&gt;where&lt;/span&gt; &lt;span style="color:Blue;"&gt;name&lt;/span&gt; &lt;span style="color:Blue;"&gt;like&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;TestInstanceStore%&amp;#39;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames) = 1
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;#39;no databases to drop&amp;#39;&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;span style="color:Blue;"&gt;else&lt;/span&gt;
    &lt;span style="color:Blue;"&gt;begin&lt;/span&gt;
		&lt;span style="color:Blue;"&gt;set&lt;/span&gt; @statement = &lt;span style="color:#A31515;"&gt;&amp;#39;drop database &amp;#39;&lt;/span&gt; + &lt;span style="color:Magenta;"&gt;substring&lt;/span&gt;(@dbnames, 2, &lt;span style="color:Magenta;"&gt;len&lt;/span&gt;(@dbnames))
		&lt;span style="color:Blue;"&gt;print&lt;/span&gt; @statement
		&lt;span style="color:Blue;"&gt;exec&lt;/span&gt; sp_executesql @statement
    &lt;span style="color:Blue;"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Do not use connection pooling&lt;/h3&gt;Connection pooling  may result in connections hanging on to the database when you don&amp;#39;t want them to.&lt;br /&gt;
&lt;h3&gt;Use SqlConnectionStringBuilder to control user supplied connection strings.  &lt;/h3&gt;Remove things you don&amp;#39;t want and add things you do want.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>ronjacobs</author><pubDate>Sat, 30 Jun 2012 17:21:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: What are some tips for unit testing with a database? 20120630052144P</guid></item></channel></rss>