{"id":259,"date":"2011-03-06T10:05:26","date_gmt":"2011-03-06T10:05:26","guid":{"rendered":"http:\/\/www.myfatblog.co.uk\/?p=259"},"modified":"2011-03-07T09:23:29","modified_gmt":"2011-03-07T09:23:29","slug":"part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used","status":"publish","type":"post","link":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/","title":{"rendered":"Part 1 &#8212; SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used."},"content":{"rendered":"<p>In my last post about the SharePoint retreat, I waxed lyrical about the costs of unit testing and why you may or may not want to get into Unit testing your code. Stepping on from this is how do we go about unit testing a SharePoint project in Visual Studio 2010? What tools do we need and what methodology do we need to follow? Just to be clear, I\u00e2\u20ac\u2122ve never unit tested anything in SharePoint before yesterday, this is all my takeaway from SharePoint retreat. For a more expert view on TDD and SharePoint, start with Andrew Woodwards blogs and slide decks on the subject and go from there\u00e2\u20ac\u00a6 <a title=\"http:\/\/www.21apps.com\/agile\/\" href=\"http:\/\/www.21apps.com\/agile\/\">http:\/\/www.21apps.com\/agile\/<\/a><\/p>\n<p>Because of the length that this will turn into, I\u00e2\u20ac\u2122m going to break it into several posts.<\/p>\n<ol>\n<li><a title=\"SPRetreat TDD \u00e2\u20ac\u201c a retrospective (See what I did there-)\" href=\"http:\/\/www.myfatblog.co.uk\/?p=251\">SPRetreat TDD \u00e2\u20ac\u201c a retrospective (See what I did there-)<\/a><\/li>\n<li>Part 1 &#8212; SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used.&#160; (this one..)<\/li>\n<li><a href=\"http:\/\/www.myfatblog.co.uk\/?p=268\" title=\"Part 2 -  SPRetreat TDD and Unit Testing, the methodology used cont..\"> Part 2 &#8211;  SPRetreat TDD and Unit Testing, the methodology used cont..<\/a><\/li>\n<\/ol>\n<h2>What\u00e2\u20ac\u2122s involved?<\/h2>\n<p>The rules of the day were:-<\/p>\n<ul>\n<ol>\n<li>You are not allowed to write any production code unless it is to make a failing unit test pass. <\/li>\n<li>You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures. <\/li>\n<li>You are not allowed to write any more production code than is sufficient to pass the one failing unit test.<\/li>\n<\/ol>\n<\/ul>\n<p>These rules, coupled with the Red, Green, Refactor (see later) aim to produce lean readable code.<\/p>\n<p>The aim of the day is to write a web part for SharePoint that contains a magic 8 ball. You\u00e2\u20ac\u2122ll be able to ask it questions and the Magic 8 Ball will automagically select the answer you need from a SharePoint list.<\/p>\n<p>In order to make the unit testing possible and also to improve the experience, I\u00e2\u20ac\u2122m using several tools recommended by Andy for the day.<\/p>\n<ul>\n<li>NUnit 2.5.9 &#8211; <a title=\"http:\/\/www.nunit.com\/\" href=\"http:\/\/www.nunit.com\/\">http:\/\/www.nunit.com\/<\/a><\/li>\n<li>Resharper V5 &#8211; <a title=\"http:\/\/www.jetbrains.com\/resharper\/\" href=\"http:\/\/www.jetbrains.com\/resharper\/\">http:\/\/www.jetbrains.com\/resharper\/<\/a> (Not free, but 30 day trial available)<\/li>\n<li>TestDriven.Net &#8211; <a title=\"http:\/\/www.testdriven.net\/\" href=\"http:\/\/www.testdriven.net\/\">http:\/\/www.testdriven.net\/<\/a> (Free version for personal development)<\/li>\n<li>TypeMock &#8211; <a title=\"http:\/\/www.typemock.com\/\" href=\"http:\/\/www.typemock.com\/\">http:\/\/www.typemock.com\/<\/a> (Not free, but 30 day trial available)<\/li>\n<\/ul>\n<p>So what are they? <\/p>\n<ol>\n<li>NUnit provides the actual unit testing framework, without it we wouldn\u00e2\u20ac\u2122t have our unit tests. There are other options such as MSTest available.<\/li>\n<li>Resharper V5 \u00e2\u20ac\u201c Provides the refactoring tools (plus other functionality), Some of which is already available in VS2010. This is my first time using it, but I quite like it. Takes some getting used to.<\/li>\n<li>TestDriven.net \u00e2\u20ac\u201c This is a VS2010 plugin that makes the process of testing easier, for instance tests can be run by key press and the output sent to the Output window rather than a pop up GUI. It\u00e2\u20ac\u2122s all about speed remember.<\/li>\n<li>TypeMock \u00e2\u20ac\u201c Mocking and isolation framework. Frankly if you want to truly isolate the SharePoint part of your SharePoint code, TypeMock is probably going to be a must. Without it, the amount of isolation you can do is reduced, but not removed entirely.<\/li>\n<\/ol>\n<p>The unit tests themselves have been written in the following form and I made sure that through the day I used the \/\/<strong><em>Arrange<\/em><\/strong> \/\/<strong><em>Act<\/em><\/strong> \/\/<strong><em>Assert<\/em><\/strong> tags throughout to remind me where I was in the test and what I\u00e2\u20ac\u2122m doing..<\/p>\n<pre class=\"csharpcode\">Public <span class=\"kwrd\">void<\/span> Method_Scenario_Behaviour()\r\n{\r\n       <span class=\"rem\">\/\/Arrange<\/span>\r\n\r\n       <span class=\"rem\">\/\/Act<\/span>\r\n\r\n      <span class=\"rem\">\/\/Assert<\/span>\r\n\r\n}<\/pre>\n<p>In the test above, we\u00e2\u20ac\u2122re arranging or setting up the test, We\u00e2\u20ac\u2122re taking an action on the object or method and then asserting that the behaviour does what we expect. This is the basic concept for all of the tests, sometimes though you\u00e2\u20ac\u2122ll bring some of the stages such as Act and Assert into a single line. (You\u00e2\u20ac\u2122ll see this when asserting an exception.)<\/p>\n<h2>Getting into the code.<\/h2>\n<p>As the retreat was about developing good skills and muscle memory, we did several sessions during the day, REPEATING all the steps from the previous session, each time progressing further down the road to our finished product. Following each session, in a true Agile fashion we held a retrospective and reviewed each others code. This was invaluable as seeing several peoples view points on the tests did open your eyes to other possibilities. The code I\u00e2\u20ac\u2122m going to develop whilst posting this blog will hopefully take us all the way to a finished SharePoint web part that utilises the Magic 8 Ball TDD code.<a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 40px 0px 20px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" align=\"right\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png\" width=\"215\" height=\"208\" \/><\/a><\/p>\n<p>On my SharePoint VM, I\u00e2\u20ac\u2122ve fired up Visual Studio 2010 and created an empty Visual Studio Solution. To this I\u00e2\u20ac\u2122ve added 2 projects, The first is my Test code and the second is my Production code. Andy suggested that we use this method with the Production code sitting in the parent namespace and the test code sitting in Parent.Test. Each namespace then contains the relevant named class E.g. Parent.Ball and ParentTest.BallTest.<\/p>\n<p>Your solution should look something like this:-<\/p>\n<p>&#160;<\/p>\n<ul>\n<li>Add a reference to NUnit.Framework.dll in your test project.<\/li>\n<li>Add the attribute [TestFixture] to your BallTest class. You\u00e2\u20ac\u2122ll note that of course Visual Studio isn\u00e2\u20ac\u2122t aware of this attribute, however Resharper is aware of your referenced objects and highlights the suggestion to you. Click on this and the relevant using statement will be added.<\/li>\n<li><a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" align=\"left\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb_3.png\" width=\"244\" height=\"88\" \/><\/a><\/li>\n<\/ul>\n<p>&#160;<\/p>\n<ul>\n<li>The next section of code is our first test and all of our subsequent tests will use this format or a variant of. I\u00e2\u20ac\u2122ve also used Resharper\u00e2\u20ac\u2122s template function to create a snippet of this test so that I can quickly add a new function. (It\u00e2\u20ac\u2122s all about speed and muscle memory don\u00e2\u20ac\u2122t forget, less mouse means more coding!)<\/li>\n<li>If you\u00e2\u20ac\u2122re typing this through yourself, another Resharper helper pops up when typing the \/\/Arrange part out. We haven\u00e2\u20ac\u2122t told the test class about the actual production code yet, so when we try and reference it, we can\u00e2\u20ac\u2122t.<a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" align=\"left\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb_4.png\" width=\"244\" height=\"131\" \/><\/a><\/li>\n<\/ul>\n<p>&#160;<\/p>\n<p>&#160;<\/p>\n<p>&#160;<\/p>\n<ul>\n<li><em>Note: A TDD purist would point out that I shouldn\u00e2\u20ac\u2122t have created the Magic8Ball production class until I\u00e2\u20ac\u2122d written a test that failed\u00e2\u20ac\u00a6 Erm, I\u00e2\u20ac\u2122m beginning at this and getting my head around it..give me a break..<\/em><font size=\"3\">&#160; <img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-smile\" alt=\"Smile\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/wlEmoticon-smile.png\" \/><\/font><\/li>\n<\/ul>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<ul>\n<li>Now that we\u00e2\u20ac\u2122ve got an object to play with, We\u00e2\u20ac\u2122ll start with our first action and call the balls AskQuestion method with a simple string. <a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" align=\"left\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb_5.png\" width=\"443\" height=\"86\" \/><\/a><\/li>\n<\/ul>\n<p>&#160;<\/p>\n<p>&#160;<\/p>\n<ul>\n<li>Wait a minute, we\u00e2\u20ac\u2122ve got what would be a compile error! That\u00e2\u20ac\u2122s a failed test.. we\u00e2\u20ac\u2122re getting into true TDD territory now! Using Resharper, we\u00e2\u20ac\u2122ll create the method that we\u00e2\u20ac\u2122re calling.<\/li>\n<li>VS2010 will switch to the production code and you\u00e2\u20ac\u2122ll find that we now have our method, complete with return type, parameters and Not Implemented Exception.<\/li>\n<\/ul>\n<pre class=\"csharpcode\"><span class=\"kwrd\">namespace<\/span> Magic8Ball\r\n{\r\n    <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">class<\/span> Ball\r\n    {\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">string<\/span> AskQuestion(<span class=\"kwrd\">string<\/span> s)\r\n        {\r\n            <span class=\"kwrd\">throw<\/span> <span class=\"kwrd\">new<\/span> NotImplementedException();\r\n        }\r\n    }\r\n}<\/pre>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<ul>\n<li>Back in our test class, we\u00e2\u20ac\u2122ll add our Assert, Your test code will look something like this:-<\/li>\n<\/ul>\n<pre class=\"csharpcode\">        [Test]\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">void<\/span> Ask_Question_ReceiveAnswer()\r\n        {\r\n            <span class=\"rem\">\/\/Arrange<\/span>\r\n            Ball ball = <span class=\"kwrd\">new<\/span> Ball();\r\n\r\n            <span class=\"rem\">\/\/Act<\/span>\r\n            <span class=\"kwrd\">string<\/span> answer = ball.AskQuestion(<span class=\"str\">&quot;q&quot;<\/span>);\r\n\r\n            <span class=\"rem\">\/\/Assert<\/span>\r\n            Assert.IsNotNullOrEmpty(answer);\r\n        }<\/pre>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<ul>\n<li>Running our first test, Either by using the NUnit icon in the breakpoint border (This will use the GUI), or using a key bind added through the usual VS2010 options\/Keyboard menu, bound to Testdriven.Nets RunTests option (Which will use the output window, not as flashy but quick!)<\/li>\n<pre class=\"csharpcode\">Test <span class=\"str\">'Magic8Ball.Test.BallTest.Ask_Question_ReceiveAnswer'<\/span> failed: System.NotImplementedException : The method or operation <span class=\"kwrd\">is<\/span> not implemented.\r\n    Ball.cs(12,0): at Magic8Ball.Ball.AskQuestion(String s)\r\n    BallTest.cs(19,0): at Magic8Ball.Test.BallTest.Ask_Question_ReceiveAnswer()\r\n\r\n0 passed, 1 failed, 0 skipped, took 0.44 seconds (NUnit 2.5.5).<\/pre>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<li>Remember, we\u00e2\u20ac\u2122re sticking to the precept of typing only enough code to fix each test as it fails. We could have changed the &quot;Throw new Not Implemented Exception\u00e2\u20ac\u009d statement, but then we\u00e2\u20ac\u2122d be breaking the rules! So as expected, our test fails.<\/li>\n<li>Switch to the production code, we now write only enough code to fix the test.<\/li>\n<pre class=\"csharpcode\">        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">string<\/span> AskQuestion(<span class=\"kwrd\">string<\/span> s)\r\n        {\r\n            <span class=\"kwrd\">return<\/span> <span class=\"str\">&quot;a&quot;<\/span>;\r\n        }<\/pre>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<li>Replacing the exception with a valid return. Now re-run the test. (Ideally by now we\u00e2\u20ac\u2122re not touching the mouse much!)<\/li>\n<pre class=\"csharpcode\">------ Test started: Assembly: Magic8Ball.Test.dll ------\r\n\r\n1 passed, 0 failed, 0 skipped, took 0.52 seconds (NUnit 2.5.5).<\/pre>\n<style type=\"text\/css\">\n.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, \"Courier New\", courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/style>\n<li>So, we\u00e2\u20ac\u2122ve failed a test, then passed a test, so using the Red, Green, Refactor rule, we need to look and see if any of the code could be refactored to make it easier to read. As we\u00e2\u20ac\u2122re on such a short piece of code now, there\u00e2\u20ac\u2122s only one thing that needs amending and that&#8217;s the parameter placed in the AskQuestion method, Variable names really need to be meaningful, so we\u00e2\u20ac\u2122ll change that \u00e2\u20ac\u0153s\u00e2\u20ac\u009d to be \u00e2\u20ac\u0153question\u00e2\u20ac\u009d.\n<\/li>\n<\/ul>\n<p>You\u00e2\u20ac\u2122ve just written your first bit of test driven code.. but we\u00e2\u20ac\u2122re not done yet, We\u00e2\u20ac\u2122ve got to get this Magic8Ball class written and tested (Or should that be tested and written?), then we need to get it into SharePoint.\n<\/p>\n<p>That\u00e2\u20ac\u2122ll continue in Part 2. TBC\u00e2\u20ac\u00a6\u00e2\u20ac\u00a6<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last post about the SharePoint retreat, I waxed lyrical about the costs of unit testing and why you may or may not want to get into Unit testing your code. Stepping on from this is how do we go about unit testing a SharePoint project in Visual Studio 2010? What tools do we &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[43,42,13,31,41,35],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Part 1 - SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used. - Blog of an overweight SharePoint addict<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Part 1 - SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used. - Blog of an overweight SharePoint addict\" \/>\n<meta property=\"og:description\" content=\"In my last post about the SharePoint retreat, I waxed lyrical about the costs of unit testing and why you may or may not want to get into Unit testing your code. Stepping on from this is how do we go about unit testing a SharePoint project in Visual Studio 2010? What tools do we &hellip; Continue reading\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog of an overweight SharePoint addict\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-06T10:05:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-03-07T09:23:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png\" \/>\n<meta name=\"author\" content=\"Cimares\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cimares\" \/>\n<meta name=\"twitter:site\" content=\"@cimares\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Cimares\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/\",\"url\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/\",\"name\":\"Part 1 - SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used. - Blog of an overweight SharePoint addict\",\"isPartOf\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png\",\"datePublished\":\"2011-03-06T10:05:26+00:00\",\"dateModified\":\"2011-03-07T09:23:29+00:00\",\"author\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/#primaryimage\",\"url\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png\",\"contentUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png\"},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\",\"url\":\"http:\/\/www.myfatblog.co.uk\/\",\"name\":\"Blog of an overweight SharePoint addict\",\"description\":\"The rantings of a (not so) food obsessed IT consultant!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.myfatblog.co.uk\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\",\"name\":\"Cimares\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg\",\"contentUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg\",\"caption\":\"Cimares\"},\"sameAs\":[\"http:\/\/www.myfatblog.co.uk\"],\"url\":\"http:\/\/www.myfatblog.co.uk\/index.php\/author\/reginald\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Part 1 - SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used. - Blog of an overweight SharePoint addict","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/","og_locale":"en_US","og_type":"article","og_title":"Part 1 - SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used. - Blog of an overweight SharePoint addict","og_description":"In my last post about the SharePoint retreat, I waxed lyrical about the costs of unit testing and why you may or may not want to get into Unit testing your code. Stepping on from this is how do we go about unit testing a SharePoint project in Visual Studio 2010? What tools do we &hellip; Continue reading","og_url":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/","og_site_name":"Blog of an overweight SharePoint addict","article_published_time":"2011-03-06T10:05:26+00:00","article_modified_time":"2011-03-07T09:23:29+00:00","og_image":[{"url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png"}],"author":"Cimares","twitter_card":"summary_large_image","twitter_creator":"@cimares","twitter_site":"@cimares","twitter_misc":{"Written by":"Cimares","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/","url":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/","name":"Part 1 - SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used. - Blog of an overweight SharePoint addict","isPartOf":{"@id":"http:\/\/www.myfatblog.co.uk\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/#primaryimage"},"image":{"@id":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/#primaryimage"},"thumbnailUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png","datePublished":"2011-03-06T10:05:26+00:00","dateModified":"2011-03-07T09:23:29+00:00","author":{"@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-1-sharepoint-retreattdd-and-unit-testing-the-methodology-used\/#primaryimage","url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png","contentUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/SharePoint-RetreatTDD-and-Unit-Testing-_7CD2\/image_thumb.png"},{"@type":"WebSite","@id":"http:\/\/www.myfatblog.co.uk\/#website","url":"http:\/\/www.myfatblog.co.uk\/","name":"Blog of an overweight SharePoint addict","description":"The rantings of a (not so) food obsessed IT consultant!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.myfatblog.co.uk\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6","name":"Cimares","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/image\/","url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg","contentUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg","caption":"Cimares"},"sameAs":["http:\/\/www.myfatblog.co.uk"],"url":"http:\/\/www.myfatblog.co.uk\/index.php\/author\/reginald\/"}]}},"_links":{"self":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/259"}],"collection":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":6,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":266,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/259\/revisions\/266"}],"wp:attachment":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}