<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/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>Hadi Hariri : MSpec, ReSharper</title><link>http://devlicio.us/blogs/hadi_hariri/archive/tags/MSpec/ReSharper/default.aspx</link><description>Tags: MSpec, ReSharper</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Machine.Specifications for ReSharper 6 now available</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2011/07/20/machine-specifications-for-resharper-6-now-available.aspx</link><pubDate>Wed, 20 Jul 2011 14:16:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:68008</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=68008</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2011/07/20/machine-specifications-for-resharper-6-now-available.aspx#comments</comments><description>&lt;p&gt;Many, myself included, have been eagerly awaiting the release of the ReSharper Runner of Machine.Specification (MSpec) for ReSharper 6. I&amp;rsquo;m glad to announce that this is now available, which is the result of a team-effort between &lt;a href="http://twitter.com/kropp"&gt;Victor Kropp&lt;/a&gt;, &lt;a href="http://twitter.com/#!/lucisferre"&gt;Chris Nicola&lt;/a&gt;, myself and of course &lt;a href="http://twitter.com/#!/agross"&gt;Alexander Gross&lt;/a&gt;, long-time contributor and main maintainer of the MSpec project. &lt;/p&gt;
&lt;p&gt;NuGet packages have already been updated to support ReSharper 6. The source code can also be obtained via &lt;a href="http://www.symbolsource.org/"&gt;SymbolSource.org&lt;/a&gt; if using NuGet or directly from &lt;a href="https://github.com/agross/machine.specifications"&gt;Alexander&amp;rsquo;s GitHub account&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/SNAGHTML5fd19d5_5F00_5FA3ABE7.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:10px 0px 0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="SNAGHTML5fd19d5" alt="SNAGHTML5fd19d5" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/SNAGHTML5fd19d5_5F00_thumb_5F00_03102A80.png" border="0" height="324" width="753" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Installing the Runner in ReSharper 6&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re new to MSpec or have simply forgotten how to install the runner under ReSharper, here are some simple steps to use Mspec in your project and integrate it with ReSharper:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1&lt;/b&gt;. Run the command &lt;i&gt;install-package&lt;/i&gt; &lt;b&gt;Machine.Specifications &lt;/b&gt;(or &lt;b&gt;Machine.Specifications-Signed&lt;/b&gt; if you want the signed version). If this is an existing project, issue the command &lt;i&gt;update-package &lt;/i&gt;instead of &lt;i&gt;install-package&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2&lt;/b&gt;. Inside the packages folder corresponding to Machine.Specifications, a &lt;i&gt;tools&lt;/i&gt; folder is created with a series of assemblies and some batch files. There are a series of batch files named InstallResharperRunner.X.X. &amp;ndash; VS20XX.bat where X&amp;rsquo;s correspond to the version of ReSharper and of Visual Studio. By executing the corresponding one, it will copy the assemblies to the ReSharper plug-in folder. &lt;/p&gt;
&lt;p&gt;You can of course do the second step manually, by copying the Machine.Specifications.ReSharperRunner.X.Y files to the ReSharper Plugins folder, located either under the ReSharper bin folder in %Program Files%\JetBrains\ReSharperX\bin (for all users) or under %APPDATA%\JetBrains\ReSharperX\bin (user-specific settings).&lt;/p&gt;
&lt;p&gt;With that you should be up and running.&lt;/p&gt;
&lt;p&gt;Enjoy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=68008" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/MSpec/default.aspx">MSpec</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Testing/default.aspx">Testing</category></item><item><title>MSpec Live Templates</title><link>http://devlicio.us/blogs/hadi_hariri/archive/2010/03/01/mspec-live-templates.aspx</link><pubDate>Mon, 01 Mar 2010 15:07:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55580</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/hadi_hariri/rsscomments.aspx?PostID=55580</wfw:commentRss><comments>http://devlicio.us/blogs/hadi_hariri/archive/2010/03/01/mspec-live-templates.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using MSpec (&lt;a href="http://github.com/machine/machine.specifications"&gt;Machine.Specifications&lt;/a&gt;), you&amp;rsquo;ve no doubt run into the verbosity of it. Here&amp;rsquo;s a typical specification in MSpec&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3ce97efd-5c56-4b7e-b368-f1899582fb49" class="wlWriterEditableSmartContent"&gt;
&lt;div style="border:#000080 1px solid;color:#000;font-family:&amp;#39;Courier New&amp;#39;, Courier, Monospace;font-size:10pt;"&gt;
&lt;div style="background:#ddd;overflow:auto;"&gt; &lt;ol style="background:#000000;margin:0 0 0 2.5em;padding:0 0 0 5px;"&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;[&lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;Subject&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;Registering as new a usergroup&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;public&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#cc7832;"&gt;class&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#ffc66d;"&gt;when_requesting_registration_page&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Establish&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; context = () =&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;Because&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; of = () =&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;span style="color:#6897bb;"&gt;It&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; should_display_blank_registration_form = () =&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#ffffff;"&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt; &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code is usually divided into three areas, the &lt;i&gt;Establish &lt;/i&gt;that defines the context, &lt;i&gt;Because &lt;/i&gt;which is defined as the action to take, and finally one or more benefits that are defined as &lt;i&gt;It&lt;/i&gt; sections. Having this layout makes it easier to understand specifications and both the console runner as well as ReSharper&amp;rsquo;s MSpec runner remove underscores and provide a nice formatting. &lt;/p&gt;
&lt;h3&gt;Live Templates&lt;/h3&gt;
&lt;p&gt;However when it comes to typing all this in, well all those brackets and symbols become tiring. For that I normally use &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt; Live Templates. If you&amp;rsquo;re not familiar with these, think of them as code snippets that allow interaction. Each template is uniquely identified by a shortcut, which is a series of characters. To invoke it, you simply type the characters and hit TAB. It then inserts some code. Up to this point it&amp;rsquo;s like a normal snippet. The twist however is that you can then TAB through placeholders and define values (I&amp;rsquo;ll cover&amp;nbsp; Live Templates and all the possibilities it allows in a future post). &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_2B76B94F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_1BF3A780.png" border="0" height="186" width="397" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;What I&amp;rsquo;ve been using for a while are some Live Templates for MSpec that allow me to define specifications with a little less effort. The first one is for empty specifications, which is useful for defining scenarios for features and then later proceeding to implement them, named &lt;i&gt;espec&lt;/i&gt;. The second one is for the specifications and implementation, named &lt;i&gt;spec&lt;/i&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_7C6457AA.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_5EA2CCEB.png" border="0" height="305" width="394" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;To install them, the easiest way is to just open up Live Templates (ReSharper menu) and Import the &lt;a href="http://hadihariri.com/Downloads/mspecbasiclivetemplate.xml"&gt;following file&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; .   &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_76E5C139.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hadi_5F00_hariri/image_5F00_thumb_5F00_272C95F0.png" border="0" height="186" width="335" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Obviously these are just two simple versions and can be expanded on. For instance, if you use Behaviors in MSpec, you could write an additional one for that. Feel free to use them for your own needs. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55580" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/ReSharper/default.aspx">ReSharper</category><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/MSpec/default.aspx">MSpec</category></item></channel></rss>