﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Repositories 101</title><description>You haven't moved the mocked instance to replay mode, probably.
</description><link>http://ayende.com/2237/repositories-101#comment10</link><guid>http://ayende.com/2237/repositories-101#comment10</guid><pubDate>Wed, 09 May 2007 10:51:14 GMT</pubDate></item><item><title>Varela commented on Repositories 101</title><description>Ok, but as i understand, the next step should be initializing the IoC class with instance of mockedContainer:
  
IoC.Initialize(mockedContainer);
  
And after that, in our tests we should be able to retrieve from IoC our mocked instance of customerRepository:
  
IRepository&lt;Customer&gt; customersRepo = IoC.Resolve&lt;IRepository&lt;Customer&gt;&gt;();
  
But this step fails for me - instance is always null. I'm doing something wrong? Or i just have entered in "stupid mode" and i'm not seeing evident things? :)
  
Anyway, thank you for the responce...
</description><link>http://ayende.com/2237/repositories-101#comment8</link><guid>http://ayende.com/2237/repositories-101#comment8</guid><pubDate>Wed, 09 May 2007 07:34:19 GMT</pubDate></item><item><title>Varela commented on Repositories 101</title><description>Ok, but as i understand, the next step should be initializing the IoC class with instance of mockedContainer:
  
IoC.Initialize(mockedContainer);
  
And after that, in our tests we should be able to retrieve from IoC our mocked instance of customerRepository:
  
IRepository&lt;Customer&gt; customersRepo = IoC.Resolve&lt;IRepository&lt;Customer&gt;&gt;();
  
But this step fails for me - instance is always null. I'm doing something wrong? Or i just have entered in "stupid mode" and i'm not seeing evident things? :)
  
Anyway, thank you for the responce...
</description><link>http://ayende.com/2237/repositories-101#comment9</link><guid>http://ayende.com/2237/repositories-101#comment9</guid><pubDate>Wed, 09 May 2007 07:34:19 GMT</pubDate></item><item><title>Ayende Rahien commented on Repositories 101</title><description>The code above makes a few assumptions, that you are using Windsor, that you are using Rhino Common's repository, etc.
  
Basically, the code in the setup is something like:
  
  
mockedContainer = mocks.DynamicMock&lt;IWindsorContainer&gt;();
  
customersRepository = mocks.DynamicMock&lt;IRepository&lt;Customer&gt;&gt;();
  
SetupResult.For(mockedContainer.Resolve&lt;IRepository&lt;Customer&gt;&gt;())
  
 .Return( customersRepository ) ;
</description><link>http://ayende.com/2237/repositories-101#comment7</link><guid>http://ayende.com/2237/repositories-101#comment7</guid><pubDate>Tue, 08 May 2007 21:20:18 GMT</pubDate></item><item><title>Varela commented on Repositories 101</title><description>Can you please sketch the ideea how to setup mocks for sample that you provide?
  
Sorry, i'm new to Rhino &amp; Windsor, but i find these tools just great. I stuck some time with [SetUp] section of my test fixture, but still not able to wire together MockRepository, Repository&lt;T&gt;, WindsorContainer &amp; IoC .
  
Thanks in advance.
  
And thank you for your posts. You provide a really good content. You do a really good job.
</description><link>http://ayende.com/2237/repositories-101#comment6</link><guid>http://ayende.com/2237/repositories-101#comment6</guid><pubDate>Tue, 08 May 2007 21:12:26 GMT</pubDate></item><item><title>Paulo Quicoli commented on Repositories 101</title><description>thanks for make things clear !
</description><link>http://ayende.com/2237/repositories-101#comment5</link><guid>http://ayende.com/2237/repositories-101#comment5</guid><pubDate>Tue, 20 Mar 2007 10:39:14 GMT</pubDate></item><item><title>Ayende Rahien commented on Repositories 101</title><description>That may be a great solution to this, yes.
  
I am concerned about the difference in implementation, but that puts a general query in the hand of the repository, and the burden of making it work is with the hands of the repository, not the app developer, which is as it should be.
</description><link>http://ayende.com/2237/repositories-101#comment4</link><guid>http://ayende.com/2237/repositories-101#comment4</guid><pubDate>Tue, 20 Mar 2007 09:53:16 GMT</pubDate></item><item><title>Andrew Peters commented on Repositories 101</title><description>Having a truly generic repository becomes a bit easier with LINQ. I implemented a version of your Repository&lt;T&gt; pattern on a recent project that used LINQ to SQL and was able to substitute an in-memory database no problems. Repository finders accept LINQ expressions that can be used to query either the database or in-memory collections.
  
  
  
</description><link>http://ayende.com/2237/repositories-101#comment3</link><guid>http://ayende.com/2237/repositories-101#comment3</guid><pubDate>Tue, 20 Mar 2007 09:40:03 GMT</pubDate></item><item><title>Steve commented on Repositories 101</title><description>I agree, Please continue Ayende  :)
  
  
Thank you sir!
  
  
</description><link>http://ayende.com/2237/repositories-101#comment2</link><guid>http://ayende.com/2237/repositories-101#comment2</guid><pubDate>Tue, 20 Mar 2007 03:01:26 GMT</pubDate></item><item><title>Christopher Bennage commented on Repositories 101</title><description>These sort of posts are really useful.  Thanks.
</description><link>http://ayende.com/2237/repositories-101#comment1</link><guid>http://ayende.com/2237/repositories-101#comment1</guid><pubDate>Tue, 20 Mar 2007 02:27:33 GMT</pubDate></item></channel></rss>