{"id":268,"date":"2011-03-06T23:00:41","date_gmt":"2011-03-06T23:00:41","guid":{"rendered":"http:\/\/www.myfatblog.co.uk\/?p=268"},"modified":"2011-03-10T22:12:17","modified_gmt":"2011-03-10T22:12:17","slug":"part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont","status":"publish","type":"post","link":"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/","title":{"rendered":"Part 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.."},"content":{"rendered":"<p>The other parts of this series can be found here\u00e2\u20ac\u00a6.<\/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><a title=\"Part 1 \u00e2\u20ac\u201d SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used\" href=\"http:\/\/www.myfatblog.co.uk\/?p=259\">Part 1 \u00e2\u20ac\u201d SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used<\/a> <\/li>\n<li>Part 2 &#8212; SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used cont.. (This post)<\/li>\n<li><a href=\"http:\/\/www.myfatblog.co.uk\/?p=305\">Part 3 &#8212; SharePoint Retreat-TDD and Unit Testing, the methodology used con..<\/a><\/li>\n<\/ol>\n<h2>Carrying on\u00e2\u20ac\u00a6.<\/h2>\n<p>At the end of the last post we\u00e2\u20ac\u2122d written the first piece of truly test driven code. Before we can look at moving to SharePoint we need to complete the Magic 8 Ball code and test it.<\/p>\n<ul>\n<li>We\u00e2\u20ac\u2122ve tested that our Ball returns an answer, but what if the user doesn\u00e2\u20ac\u2122t ask it a question? Here\u00e2\u20ac\u2122s our next test.. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">void<\/span> Ask_EmptyQuestion_ReceiveArgumentException()\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=\"rem\">\/\/Assert<\/span>\r\n            Assert.Throws&lt;ArgumentException&gt;(() =&gt; ball.AskQuestion(<span class=\"str\">&quot;&quot;<\/span>));\r\n        }<\/pre>\n<ul>\n<li>This time you can see that the act and assert are on the same line, perfectly valid in this instance. Running the test fails as we\u00e2\u20ac\u2122d expect as we\u00e2\u20ac\u2122re not doing anything in the production code to test for an empty question. We\u00e2\u20ac\u2122ll fix it now, remembering the MINIMUM code to fix the test that failed! <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">string<\/span> AskQuestion(<span class=\"kwrd\">string<\/span> question)\r\n        {\r\n            <span class=\"kwrd\">if<\/span> (<span class=\"kwrd\">string<\/span>.IsNullOrEmpty(question))\r\n                <span class=\"kwrd\">throw<\/span> <span class=\"kwrd\">new<\/span> ArgumentException();\r\n\r\n            <span class=\"kwrd\">return<\/span> <span class=\"str\">&quot;a&quot;<\/span>;\r\n        }<\/pre>\n<ul>\n<li>Running the test again, it passes as we\u00e2\u20ac\u2122d expect. Red, Green, Refactor.. Let\u00e2\u20ac\u2122s make that method more readable by refactoring out the string test into it\u00e2\u20ac\u2122s own method. (using Resharper) <\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 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=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_thumb.png\" width=\"487\" height=\"394\" \/><\/a><\/p>\n<ul>\n<li>This gives us our protected method that we can now use elsewhere. <\/li>\n<\/ul>\n<p>Moving on again, the next test.<\/p>\n<ul>\n<li>When we ask a question, we should receive an answer from a collection of answers. <\/li>\n<li>This time we need ball to contain a collection of Answers. Our arrange block looks like this:- <\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 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=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_thumb_3.png\" width=\"559\" height=\"83\" \/><\/a><\/p>\n<ul>\n<li>ball.Answers&#160; in red looks like a compile failure and thus a valid fail. As we did before, we\u00e2\u20ac\u2122ll let Resharper create the public property for this, thus passing that test. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        [Test]\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">void<\/span> Ask_ValidQuestion_ReceiveAnswerFromCollection()\r\n        {\r\n            <span class=\"rem\">\/\/Arrange<\/span>\r\n            Ball ball = <span class=\"kwrd\">new<\/span> Ball();\r\n            ball.Answers = <span class=\"kwrd\">new<\/span> List&lt;<span class=\"kwrd\">string<\/span>&gt;() {<span class=\"str\">&quot;a&quot;<\/span>, <span class=\"str\">&quot;b&quot;<\/span>, <span class=\"str\">&quot;c&quot;<\/span>};\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.Contains(answer,ball.Answers);\r\n        }<\/pre>\n<ul>\n<li>When we run the test this time, we get an exception error because of course Resharper only created the public field, but it left in \u00e2\u20ac\u0153not implemented exceptions\u00e2\u20ac\u009d, so we\u00e2\u20ac\u2122ll fix those. You\u00e2\u20ac\u2122ll also note that it only added a public property, not an matching internal field. As this is a nice simple property, I changed it to an auto property. <\/li>\n<li>Running the test again we now pass. (You might have spotted a problem at this point.. but read on.. Remember only enough code to fix a failed test!) <\/li>\n<li>This time our test is looking to receive a random answer from the selection available. To test this, we\u00e2\u20ac\u2122ll ask 1000 questions and use a list to check we receive all three, breaking out the loop once we do. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        [Test]\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">void<\/span> Ask_ValidQuestion_ReceiveRandomAnswer()\r\n        {\r\n            <span class=\"rem\">\/\/Arrange<\/span>\r\n            Ball ball = <span class=\"kwrd\">new<\/span> Ball();\r\n            ball.Answers = <span class=\"kwrd\">new<\/span> List&lt;<span class=\"kwrd\">string<\/span>&gt;(){<span class=\"str\">&quot;a&quot;<\/span>,<span class=\"str\">&quot;b&quot;<\/span>,<span class=\"str\">&quot;c&quot;<\/span>};\r\n            <span class=\"kwrd\">bool<\/span> allAnswersChosen = <span class=\"kwrd\">false<\/span>;\r\n            List&lt;<span class=\"kwrd\">string<\/span>&gt; returnedAnswers = <span class=\"kwrd\">new<\/span> List&lt;<span class=\"kwrd\">string<\/span>&gt;();\r\n            \r\n\r\n            <span class=\"rem\">\/\/Act<\/span>\r\n            <span class=\"kwrd\">for<\/span> (<span class=\"kwrd\">int<\/span> i = 0; i &lt; 1000; i++)\r\n            {\r\n                <span class=\"rem\">\/\/Added Thread sleep to allow the randomiser to be random.<\/span>\r\n                Thread.Sleep(5);\r\n\r\n                <span class=\"kwrd\">string<\/span> answer = ball.AskQuestion(<span class=\"str\">&quot;q&quot;<\/span>);\r\n\r\n                <span class=\"kwrd\">if<\/span> (!returnedAnswers.Contains(answer))\r\n                    returnedAnswers.Add(answer);\r\n\r\n                <span class=\"kwrd\">if<\/span> (returnedAnswers.Count == 3)\r\n                {\r\n                    allAnswersChosen = <span class=\"kwrd\">true<\/span>;\r\n                    <span class=\"kwrd\">break<\/span>;\r\n                }\r\n            }\r\n\r\n            <span class=\"rem\">\/\/Assert<\/span>\r\n            Assert.IsTrue(allAnswersChosen);\r\n        }<\/pre>\n<ul>\n<li>This time the test fails because we\u00e2\u20ac\u2122re only returning \u00e2\u20ac\u0153a\u00e2\u20ac\u009d from our very first test, (Which is also the reason the last test passed once we fixed the exceptions!) <\/li>\n<li>To fix this, we\u00e2\u20ac\u2122ll add a randomiser to our code and use it as an indexer to the Answers collection. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">string<\/span> AskQuestion(<span class=\"kwrd\">string<\/span> question)\r\n        {\r\n            GuardEmptyString(question);\r\n\r\n            <span class=\"kwrd\">return<\/span> Answers[GetRandomIndex()];\r\n        }\r\n\r\n        <span class=\"kwrd\">private<\/span> <span class=\"kwrd\">int<\/span> GetRandomIndex()\r\n        {\r\n            Random rnd = <span class=\"kwrd\">new<\/span> Random();\r\n            <span class=\"kwrd\">return<\/span> rnd.Next(Answers.Count);\r\n        }<\/pre>\n<ul>\n<li>Running the tests again, our randomiser works, BUT one of our earlier tests is now broken! Adding the randomiser has introduced a Null Reference Exception. At this point, we need to make a decision, can we safely ignore this test and mark it as such, or do we need to amend the test? In this case, I\u00e2\u20ac\u2122m going to amend the test to take into account the new collection that is required. <\/li>\n<li>Adding the following to our first test allows all the tests to pass once more. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">            <span class=\"rem\">\/\/Added this after later tests caused a failure.<\/span>\r\n            ball.Answers = <span class=\"kwrd\">new<\/span> List&lt;<span class=\"kwrd\">string<\/span>&gt;(){<span class=\"str\">&quot;a&quot;<\/span>};<\/pre>\n<style type=\"text\/css\">\n<p>.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>During the retrospective on this, Andrew raised the point of why we\u00e2\u20ac\u2122d started using logic in our Test for the random function. As he rightly pointed out, Microsoft have already tested the Random object, so why are we redoing their work? This is known as crossing the seams and isn\u00e2\u20ac\u2122t necessary! <\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/Dontcrosstheseams.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px\" title=\"Dontcrosstheseams\" border=\"0\" alt=\"Dontcrosstheseams\" src=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/Dontcrosstheseams_thumb.jpg\" width=\"361\" height=\"203\" \/><\/a><\/p>\n<ul>\n<li>In order to test the behaviour here, we have one of two choices, We can either use the extract and overide method, or we can use TypeMock to isolate the randomiser and replace it\u00e2\u20ac\u2122s behaviour. <\/li>\n<li>The extract and overide method requires us to create a new FakeBall class in our test namespace, that inherits from our Ball class. We then adjust the Ball class to make it\u00e2\u20ac\u2122s randomiser method to be protected virtual rather than private. This allows us to override it\u00e2\u20ac\u2122s behaviour in our FakeBall class. <\/li>\n<li>In our FakeBall class, we want to pass it in a value that will be passed back to the Base ball object, thus choosing which index to return. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">    <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">class<\/span> FakeBall : Ball\r\n    {\r\n        <span class=\"kwrd\">public<\/span> FakeBall(<span class=\"kwrd\">int<\/span> chosenIndex)\r\n        {\r\n            requiredIndex = chosenIndex;\r\n        }\r\n\r\n        <span class=\"kwrd\">private<\/span> <span class=\"kwrd\">int<\/span> requiredIndex;\r\n\r\n        <span class=\"kwrd\">protected<\/span> <span class=\"kwrd\">override<\/span> <span class=\"kwrd\">int<\/span> GetRandomIndex()\r\n        {\r\n            <span class=\"kwrd\">return<\/span> requiredIndex;\r\n        }\r\n    }<\/pre>\n<style type=\"text\/css\">\n<p>.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>We can now use NUnit\u00e2\u20ac\u2122s test case functionality to run the same test three times with different parameters. The test should be fairly self explantory, just note that we\u00e2\u20ac\u2122re using the FAKEBALL object this time round, passing in our chosen index, thus bypassing the randomiser. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        [TestCase(<span class=\"str\">&quot;a&quot;<\/span>, 0)]\r\n        [TestCase(<span class=\"str\">&quot;b&quot;<\/span>, 1)]\r\n        [TestCase(<span class=\"str\">&quot;c&quot;<\/span>, 2)]\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">void<\/span> Ask_ValidQuestion_GetChosenAnswer(<span class=\"kwrd\">string<\/span> expectedAnswer,<span class=\"kwrd\">int<\/span> chosenIndex)\r\n        {\r\n            <span class=\"rem\">\/\/Arrange<\/span>\r\n            FakeBall ball = <span class=\"kwrd\">new<\/span> FakeBall(chosenIndex);\r\n            ball.Answers = <span class=\"kwrd\">new<\/span> List&lt;<span class=\"kwrd\">string<\/span>&gt;(){<span class=\"str\">&quot;a&quot;<\/span>,<span class=\"str\">&quot;b&quot;<\/span>,<span class=\"str\">&quot;c&quot;<\/span>};\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.AreEqual(answer,expectedAnswer);\r\n\r\n        }<\/pre>\n<ul>\n<li>Run the test and if you\u00e2\u20ac\u2122re only running this one, you should see 3 passes. <\/li>\n<\/ul>\n<p>As I said, you could have used TypeMock in this instance too. I\u00e2\u20ac\u2122ve added a reference to the TypeMock dll\u00e2\u20ac\u2122s now (I\u00e2\u20ac\u2122d have need them later anyhow..). Add references for TypeMock.dll and TypeMock_ArrangeActAssert.dll (You may receive an error about TypeMock requiring a later version of .net, but as we\u00e2\u20ac\u2122re wanting to add a SharePoint project to this solution, we\u00e2\u20ac\u2122ll leave it at .Net 3.5)<\/p>\n<ul>\n<li>This code block performs exactly the same test as before, but doesn\u00e2\u20ac\u2122t require any change to the production code, so a very powerful way of performing dependency injection. This is only available in the full product of TypeMock Isolator and not the SharePoint specific edition. <\/li>\n<\/ul>\n<pre class=\"csharpcode\">        [TestCase(<span class=\"str\">&quot;a&quot;<\/span>, 0)]\r\n        [TestCase(<span class=\"str\">&quot;b&quot;<\/span>, 1)]\r\n        [TestCase(<span class=\"str\">&quot;c&quot;<\/span>, 2)]\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">void<\/span> Ask_ValidQuestion_GetChosenAnswerWithTypeMock(<span class=\"kwrd\">string<\/span> expectedAnswer, <span class=\"kwrd\">int<\/span> chosenIndex)\r\n        {\r\n            <span class=\"rem\">\/\/Arrange<\/span>\r\n            Ball ball = <span class=\"kwrd\">new<\/span> Ball();\r\n            ball.Answers = <span class=\"kwrd\">new<\/span> List&lt;<span class=\"kwrd\">string<\/span>&gt;(){<span class=\"str\">&quot;a&quot;<\/span>,<span class=\"str\">&quot;b&quot;<\/span>,<span class=\"str\">&quot;c&quot;<\/span>};\r\n\r\n            Isolate.NonPublic.WhenCalled(ball,<span class=\"str\">&quot;GetRandomIndex&quot;<\/span>).WillReturn(chosenIndex);\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.AreEqual(answer,expectedAnswer);\r\n        }<\/pre>\n<style type=\"text\/css\">\n<p>.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<p>Now at this point, I don\u00e2\u20ac\u2122t think there are any other tests that I need to perform, In fact once you start having to rack your brain for another test, it\u00e2\u20ac\u2122s probably time to move on. At this point, we now have a working Magic 8 Ball object that answers questions with a random selection from a supplied list.<\/p>\n<p>The next step it to take our working Magic 8 Ball and start surfacing it in a SharePoint web part and test it against the SharePoint object model using TypeMock to isolate us and stop us crossing the seam! That\u00e2\u20ac\u2122ll happen in Part 3.<\/p>\n<p>Paul.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other parts of this series can be found here\u00e2\u20ac\u00a6. SPRetreat TDD \u00e2\u20ac\u201c a retrospective (See what I did there? -) Part 1 \u00e2\u20ac\u201d SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used Part 2 &#8212; SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used cont.. (This post) Part 3 &#8212; SharePoint Retreat-TDD and Unit Testing, the &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/\">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,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 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.. - 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=\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Part 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.. - Blog of an overweight SharePoint addict\" \/>\n<meta property=\"og:description\" content=\"The other parts of this series can be found here\u00e2\u20ac\u00a6. SPRetreat TDD \u00e2\u20ac\u201c a retrospective (See what I did there? -) Part 1 \u00e2\u20ac\u201d SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used Part 2 &#8212; SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used cont.. (This post) Part 3 &#8212; SharePoint Retreat-TDD and Unit Testing, the &hellip; Continue reading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog of an overweight SharePoint addict\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-06T23:00:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-03-10T22:12:17+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/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\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/\",\"url\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/\",\"name\":\"Part 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.. - Blog of an overweight SharePoint addict\",\"isPartOf\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_thumb.png\",\"datePublished\":\"2011-03-06T23:00:41+00:00\",\"dateModified\":\"2011-03-10T22:12:17+00:00\",\"author\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/#primaryimage\",\"url\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_thumb.png\",\"contentUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/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 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.. - 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":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/","og_locale":"en_US","og_type":"article","og_title":"Part 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.. - Blog of an overweight SharePoint addict","og_description":"The other parts of this series can be found here\u00e2\u20ac\u00a6. SPRetreat TDD \u00e2\u20ac\u201c a retrospective (See what I did there? -) Part 1 \u00e2\u20ac\u201d SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used Part 2 &#8212; SharePoint Retreat\u00e2\u20ac\u201cTDD and Unit Testing, the methodology used cont.. (This post) Part 3 &#8212; SharePoint Retreat-TDD and Unit Testing, the &hellip; Continue reading","og_url":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/","og_site_name":"Blog of an overweight SharePoint addict","article_published_time":"2011-03-06T23:00:41+00:00","article_modified_time":"2011-03-10T22:12:17+00:00","og_image":[{"url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/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":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/","url":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/","name":"Part 2&ndash;SharePoint Retreat&ndash;TDD and Unit Testing, the methodology used cont.. - Blog of an overweight SharePoint addict","isPartOf":{"@id":"http:\/\/www.myfatblog.co.uk\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/#primaryimage"},"image":{"@id":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/#primaryimage"},"thumbnailUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_thumb.png","datePublished":"2011-03-06T23:00:41+00:00","dateModified":"2011-03-10T22:12:17+00:00","author":{"@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.myfatblog.co.uk\/index.php\/2011\/03\/part-2sharepoint-retreattdd-and-unit-testing-the-methodology-used-cont\/#primaryimage","url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/image_thumb.png","contentUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/Part-2SharePoint-RetreatTDD-and-Unit-Tes_11173\/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\/268"}],"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=268"}],"version-history":[{"count":29,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":296,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/268\/revisions\/296"}],"wp:attachment":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}