<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Unit Testing SharePoint - Getting into the Object Model</title>
	<atom:link href="http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/</link>
	<description></description>
	<pubDate>Sun, 05 Jul 2009 20:27:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Reza Alirezaei&#8217;s Blog &#187; MVPs by MVPs in 2008</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-701</link>
		<dc:creator>Reza Alirezaei&#8217;s Blog &#187; MVPs by MVPs in 2008</dc:creator>
		<pubDate>Thu, 08 Jan 2009 21:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-701</guid>
		<description>[...] 11)Andrew Woodward:http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/12)Jake Dan Attis : [...]</description>
		<content:encoded><![CDATA[<p>[...] 11)Andrew Woodward:http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/12)Jake Dan Attis : [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SharePoint and Unit Testing &#171; iSea</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-665</link>
		<dc:creator>SharePoint and Unit Testing &#171; iSea</dc:creator>
		<pubDate>Tue, 23 Dec 2008 05:38:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-665</guid>
		<description>[...] http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/" rel="nofollow">http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Isolator for SharePoint &#171; Solutionizing .NET</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-623</link>
		<dc:creator>Isolator for SharePoint &#171; Solutionizing .NET</dc:creator>
		<pubDate>Tue, 25 Nov 2008 05:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-623</guid>
		<description>[...] model. However, Andrew Woodward recently posted a whitepaper on the subject that caught my eye: Unit Testing SharePoint Solutions - Getting into the Object Model. Featured in the paper is Typemock Isolator, which has just been released in a special [...]</description>
		<content:encoded><![CDATA[<p>[...] model. However, Andrew Woodward recently posted a whitepaper on the subject that caught my eye: Unit Testing SharePoint Solutions - Getting into the Object Model. Featured in the paper is Typemock Isolator, which has just been released in a special [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garth</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-585</link>
		<dc:creator>Garth</dc:creator>
		<pubDate>Fri, 14 Nov 2008 07:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-585</guid>
		<description>Here's some sample code of the Natural Mocks I'm using now (nothing worse than a posting that says I've got it working an no sample code ;) )

/////////////////////////////////////////////////
SPList list = RecorderManager.CreateMockedObject();
            SPListItem item = RecorderManager.CreateMockedObject();
            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                recorder.ExpectAndReturn(list.GetItemById(1), item);

                recorder.ExpectAndReturn(item["ID"], 1);
                recorder.ExpectAndReturn(item["Customer Name"], "Bob Jones");
                recorder.ExpectAndReturn(item["NumberOfItems"], 2);
                
            }</description>
		<content:encoded><![CDATA[<p>Here&#8217;s some sample code of the Natural Mocks I&#8217;m using now (nothing worse than a posting that says I&#8217;ve got it working an no sample code <img src='http://www.21apps.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p>/////////////////////////////////////////////////<br />
SPList list = RecorderManager.CreateMockedObject();<br />
            SPListItem item = RecorderManager.CreateMockedObject();<br />
            using (RecordExpectations recorder = RecorderManager.StartRecording())<br />
            {<br />
                recorder.ExpectAndReturn(list.GetItemById(1), item);</p>
<p>                recorder.ExpectAndReturn(item["ID"], 1);<br />
                recorder.ExpectAndReturn(item["Customer Name"], &#8220;Bob Jones&#8221;);<br />
                recorder.ExpectAndReturn(item["NumberOfItems"], 2);</p>
<p>            }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garth</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-584</link>
		<dc:creator>Garth</dc:creator>
		<pubDate>Fri, 14 Nov 2008 07:24:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-584</guid>
		<description>Cool. Thanks for the response. I'm using Natural Mocks for this instance and it's working. 

Shotto</description>
		<content:encoded><![CDATA[<p>Cool. Thanks for the response. I&#8217;m using Natural Mocks for this instance and it&#8217;s working. </p>
<p>Shotto</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doron</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-583</link>
		<dc:creator>Doron</dc:creator>
		<pubDate>Thu, 13 Nov 2008 13:11:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-583</guid>
		<description>@Garth,

This is indeed a missing feature in Typemock Isolator - we don't handle conditional expectations correctly with our AAA API. This feature is supported by our older APIs (see the discussion on the Isolator forums here: http://www.typemock.com/community/viewtopic.php?t=1030&#38;highlight=). 

We are working on extending the AAA API with more features like this one, so you can pretty safely assume you'll get it in an upcoming version.

Doron (developer, Typemock)</description>
		<content:encoded><![CDATA[<p>@Garth,</p>
<p>This is indeed a missing feature in Typemock Isolator - we don&#8217;t handle conditional expectations correctly with our AAA API. This feature is supported by our older APIs (see the discussion on the Isolator forums here: <a href="http://www.typemock.com/community/viewtopic.php?t=1030&amp;highlight=" rel="nofollow">http://www.typemock.com/community/viewtopic.php?t=1030&amp;highlight=</a>). </p>
<p>We are working on extending the AAA API with more features like this one, so you can pretty safely assume you&#8217;ll get it in an upcoming version.</p>
<p>Doron (developer, Typemock)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garth</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-581</link>
		<dc:creator>Garth</dc:creator>
		<pubDate>Thu, 13 Nov 2008 09:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-581</guid>
		<description>Thanks for this article it's great!

I'm having a bit of a funny happening in my code and I was wondering if it's me or the the API. 

I've set up the following: 
// ----------------------------------------------------------
SPList list = Isolate.Fake.Instance(Members.ReturnRecursiveFakes);
            SPListItem item = Isolate.Fake.Instance(Members.ReturnRecursiveFakes);

            Isolate.Swap.NextInstance().With(list);
            Isolate.Swap.NextInstance().With(item);
            
            Isolate.WhenCalled(() =&#62; list.GetItemById(1)).WillReturn(item);
            Isolate.WhenCalled(() =&#62; item["Customer Name"]).WillReturn("Bob Jones");
            Isolate.WhenCalled(() =&#62; item["NumberOfItems"]).WillReturn(2);
// ----------------------------------------------------------
However when I call item["Customer Name"] the mock object returns '2' instead of 'Bob Jones' it appears to be ignoring the field name set in the item[] and just returns the last value that was set with 'WhenCalled()'. 

Have I set this up incorrectly?
Thanks</description>
		<content:encoded><![CDATA[<p>Thanks for this article it&#8217;s great!</p>
<p>I&#8217;m having a bit of a funny happening in my code and I was wondering if it&#8217;s me or the the API. </p>
<p>I&#8217;ve set up the following:<br />
// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
SPList list = Isolate.Fake.Instance(Members.ReturnRecursiveFakes);<br />
            SPListItem item = Isolate.Fake.Instance(Members.ReturnRecursiveFakes);</p>
<p>            Isolate.Swap.NextInstance().With(list);<br />
            Isolate.Swap.NextInstance().With(item);</p>
<p>            Isolate.WhenCalled(() =&gt; list.GetItemById(1)).WillReturn(item);<br />
            Isolate.WhenCalled(() =&gt; item["Customer Name"]).WillReturn(&#8221;Bob Jones&#8221;);<br />
            Isolate.WhenCalled(() =&gt; item["NumberOfItems"]).WillReturn(2);<br />
// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
However when I call item["Customer Name"] the mock object returns &#8216;2&#8242; instead of &#8216;Bob Jones&#8217; it appears to be ignoring the field name set in the item[] and just returns the last value that was set with &#8216;WhenCalled()&#8217;. </p>
<p>Have I set this up incorrectly?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Velez</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-569</link>
		<dc:creator>Gustavo Velez</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-569</guid>
		<description>Hi Andrew,
Yes, I agree, we are in the same wave… finally, the purpose is to make possible Unit Test for SharePoint, and you, the folk at TypeMocks and other couple of persons are making it achievable. Together with Carlos Segura (http://www.ideseg.com), other MVP MOSS, are we working very close with Gil Zilberfeld, Avi Kaye and Roy Osherove of TypeMocks to test the new versions, and trying to pull out the best of the tool… by the way, the things that they are making and that are now in the pipe-line are very exciting, in special for SharePoint, don’t think you so?…
Gustavo Velez [MVP MOSS]</description>
		<content:encoded><![CDATA[<p>Hi Andrew,<br />
Yes, I agree, we are in the same wave… finally, the purpose is to make possible Unit Test for SharePoint, and you, the folk at TypeMocks and other couple of persons are making it achievable. Together with Carlos Segura (http://www.ideseg.com), other MVP MOSS, are we working very close with Gil Zilberfeld, Avi Kaye and Roy Osherove of TypeMocks to test the new versions, and trying to pull out the best of the tool… by the way, the things that they are making and that are now in the pipe-line are very exciting, in special for SharePoint, don’t think you so?…<br />
Gustavo Velez [MVP MOSS]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Woodward</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-568</link>
		<dc:creator>Andrew Woodward</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:11:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-568</guid>
		<description>Gustavo,
I've updated the post as after noting you comment it was not obvious which white paper to download.  
No real reason for using NUnit over the test tools in Visual Studio just that's what I'm used to.  

I think we are really on the same page and look forward to talking to you more on the SPTypeMock project.</description>
		<content:encoded><![CDATA[<p>Gustavo,<br />
I&#8217;ve updated the post as after noting you comment it was not obvious which white paper to download.<br />
No real reason for using NUnit over the test tools in Visual Studio just that&#8217;s what I&#8217;m used to.  </p>
<p>I think we are really on the same page and look forward to talking to you more on the SPTypeMock project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Velez</title>
		<link>http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/#comment-567</link>
		<dc:creator>Gustavo Velez</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.21apps.com/?p=592#comment-567</guid>
		<description>Hi Andrew,
My apologies for the mistake about the document: you are right; I was looking to the wrong file. And indeed, in the pages that you mention you are using SharePoint code, thus I retract my comment concerning that.
About your second comment, well, formally speaking you are right, future testing it is not really Unit Test, it is more Regression Test (I like to see Integration Test more as how code behave in relation with other parts of the project, not in relation with the host [SharePoint in our case]). As I say in the article, I like to have different thinks in a Unit Test for SharePoint:
-	It needs to be repeatable: each developer in the team need to use the same test-set with the same results, also in the future
-	It needs to have no references to the actual state of SharePoint: otherwise it cannot be repeatable. Mocking is the only solution, I think. Your point about Integration Test is correct, Integration Test to the actual state of SharePoint is nonsense
-	It needs to be fast (as you mentioned): but in a bigger meaning, it needs to be faster to run, but it needs to be faster to code as well… the task of the developer is to write functional code; if you need to write 2 lines of test-code for each line of working-code, we are doing something wrong…
By the way, I was wondering why do you not use the Test Tools of Visual Studio? (you use NUnit, I see it in your document)… have you found something that run better in NUnit than in VS? I’m using the latest version of TypeMocks with VS 2008 and its default Test Tools without any nuisance...
Greetings
Gustavo Velez [MVP MOSS]</description>
		<content:encoded><![CDATA[<p>Hi Andrew,<br />
My apologies for the mistake about the document: you are right; I was looking to the wrong file. And indeed, in the pages that you mention you are using SharePoint code, thus I retract my comment concerning that.<br />
About your second comment, well, formally speaking you are right, future testing it is not really Unit Test, it is more Regression Test (I like to see Integration Test more as how code behave in relation with other parts of the project, not in relation with the host [SharePoint in our case]). As I say in the article, I like to have different thinks in a Unit Test for SharePoint:<br />
-	It needs to be repeatable: each developer in the team need to use the same test-set with the same results, also in the future<br />
-	It needs to have no references to the actual state of SharePoint: otherwise it cannot be repeatable. Mocking is the only solution, I think. Your point about Integration Test is correct, Integration Test to the actual state of SharePoint is nonsense<br />
-	It needs to be fast (as you mentioned): but in a bigger meaning, it needs to be faster to run, but it needs to be faster to code as well… the task of the developer is to write functional code; if you need to write 2 lines of test-code for each line of working-code, we are doing something wrong…<br />
By the way, I was wondering why do you not use the Test Tools of Visual Studio? (you use NUnit, I see it in your document)… have you found something that run better in NUnit than in VS? I’m using the latest version of TypeMocks with VS 2008 and its default Test Tools without any nuisance&#8230;<br />
Greetings<br />
Gustavo Velez [MVP MOSS]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
