﻿<?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>jdn commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>http://www.blogcoward.com/archive/2007/05/13/15.aspx
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment25</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment25</guid><pubDate>Mon, 14 May 2007 01:03:58 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>@Robert,
  
Rhino Mocks had using() scope for verification at the beginning, but it was removed because people kept running into issues with it.
  
The most common issue was that if an exception was thrown when the mocks was in an invalid state, the using's dispose kicked in, attempted to verify, failed, and then threw a _different_ exception, masking the real issue.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment24</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment24</guid><pubDate>Wed, 04 Apr 2007 04:35:24 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>I am aware of the Repeat Test Run, but I keep forgetting about it.
  
It is great when I am in the code, and I can just run the test again and again until I get it right.
  
In fact, if I am not mistaken, this is there because of a feature requst I made.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment23</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment23</guid><pubDate>Wed, 04 Apr 2007 04:33:26 GMT</pubDate></item><item><title>Christopher Bennage commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Ayende has published an excellent sceencast introduction to Rhino Mocks . If you are at least somewhat
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment22</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment22</guid><pubDate>Tue, 03 Apr 2007 16:01:30 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Thanks, and it is consolas.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment21</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment21</guid><pubDate>Tue, 03 Apr 2007 10:27:46 GMT</pubDate></item><item><title>Kirill commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Great screencast! Btw, what font do you use in visual studio?
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment20</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment20</guid><pubDate>Tue, 03 Apr 2007 06:13:40 GMT</pubDate></item><item><title>Robert Taylor commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>I really like the video - you did an excelent job of showing how to use RhinoMocks in a (near) real-world scenario.  You mentioned how it is common for developers to forget to call ReplayAll() and i think i have a solution to that problem: take advantage of the "using" statement in the language by implementing a couple of new APIs and IDisposable...
  
  
using System;
  
using MbUnit.Framework;
  
using Rhino.Mocks.Constraints;
  
  
namespace Rhino.Mocks.Demo
  
{
  
  [TestFixture]
  
  public class RhinoMocks101Fixture
  
  {
  
    private MockRepository mockRepository;
  
    private ISmsSender smsSender;
  
    private IUserRepository userRepository;
  
    private User user;
  
    private LoginController loginController;
  
  
    [SetUp]
  
    public void TestInitialize()
  
    {
  
      mockRepository = new MockRepository();
  
      smsSender = mockRepository.CreateMock&lt;ISmsSender&gt;();
  
      userRepository = mockRepository.CreateMock&lt;IUserRepository&gt;();
  
      user = CreateUser();
  
  
      loginController = new LoginController(smsSender, this.userRepository);
  
    }
  
  
    [Test]
  
    public void WillSendSMSWhenUserRequestNewPassword()
  
    {
  
      //nested scopes are not allowed; exception will be thrown
  
      //calling any mocked API outside of a scope will throw an exception
  
      using (this.mockRepository.RecordScope())
  
      {
  
        Expect.Call(this.userRepository.GetById("sally")).Return(this.user);
  
        smsSender.SendSms(null, null);
  
        LastCall.Constraints(Is.Equal(this.user.Phone), Text.StartsWith("New passord:"));
  
      }
  
  
      using (this.mockRepository.PlaybackScope())
  
      {
  
        loginController.SendNewPassword(this.user.Name);
  
      } //disposing of the PlaybackScope will call VerifyAll()
  
  
      Assert.AreNotEqual("old", this.user.Password, "expected the password to change");
  
    }
  
  }
  
}
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment19</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment19</guid><pubDate>Fri, 30 Mar 2007 15:10:03 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Oh, that is just the post text, actually. sorry about being confusing
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment18</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment18</guid><pubDate>Fri, 30 Mar 2007 10:52:51 GMT</pubDate></item><item><title>Gulli commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>The confusion is about the text "You can watch it here" where "here" is a link.
  
  
Naturally, we click "here", but that's just a link to the same page. :)
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment17</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment17</guid><pubDate>Fri, 30 Mar 2007 10:16:22 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>What do you mean, you can't download it?
  
The link in the post goes to the download page, and the link to actually download the link to actually download the file is in the bottom of the screen.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment16</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment16</guid><pubDate>Fri, 30 Mar 2007 08:06:17 GMT</pubDate></item><item><title>Adam Tybor commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>@Joe
  
Checkout Rhino Commons, it has some nice text fixture stubs in ForTesting that allows you to use SqlCe and SqlLite to do quick "integration testing".
  
  
While CRUD testing is important the ORM handles this for you.  The only persistence stuff I test is ensuring things like lazy loading and cascades are being handled properly.  SqlCe works perfect for that.  For the heavier integration tests we let our CI server handle that.  Rarely do we find that integration tests fail if all unit tests are passing.
  
  
Adam
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment15</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment15</guid><pubDate>Fri, 30 Mar 2007 04:41:50 GMT</pubDate></item><item><title>Doug Rohm commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>I can't get it to download either.  The links in the post go to the same page..  I also have the plugin installed so it can't be that...
  
  
Doug
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment14</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment14</guid><pubDate>Thu, 29 Mar 2007 23:58:11 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>@Liang, 
  
You need to install the TSCC plugin (you can find the download link at the download page) and watch it in Windows Media Player
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment13</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment13</guid><pubDate>Thu, 29 Mar 2007 17:11:30 GMT</pubDate></item><item><title>Ralf commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Download works like a charm, screencast is really good. Maybe the next time you should post at what time in the screencast you start coding, so I can jump just there ;-)
  
One thing I noticed: You always go back to the unit test code after you have changed something and have to run the test again. Are you doing that intentionally for the sake of the screencast or are you unware of Testdrivens "Repeat Test Run" command. I know it took me a couple of month until I discovered it. Know I have a keyboard shortcut for it
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment12</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment12</guid><pubDate>Thu, 29 Mar 2007 16:15:46 GMT</pubDate></item><item><title>Liang commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Which tool we should use to view? I only can hear... Thanks!
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment11</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment11</guid><pubDate>Thu, 29 Mar 2007 14:56:31 GMT</pubDate></item><item><title>Joe commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>You mention early on that you consider testing webservices / database calls to be integration testing.  A lot of what I (and I would imagine pleanty of other people) do centers around getting the stored procs / views set up and ensuring that the right data is being returned, and for those of us not using any kind of OR/M, ensuring that we can do the CRUD from our applications.  What would be your suggestion on how to approach this?
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment10</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment10</guid><pubDate>Thu, 29 Mar 2007 14:43:18 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>@Ralf,
  
Please try now, it is working.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment9</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment9</guid><pubDate>Thu, 29 Mar 2007 06:36:01 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>@Chris,
  
I did some work a while ago about mocking WCF, you can search the blog on that
  
ASP.Net itself is not mockable/testable easily, and that is a big draw back as far as I am concerned.
  
I am talking about it in the screencast, but in general it is a bad thing to mock stuff that you don't controol/own.
  
The reason is that you usually does a lot of low granularity work with it, which is a PITA to mock.
  
Adapters are usually the answer for this case.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment8</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment8</guid><pubDate>Thu, 29 Mar 2007 06:31:56 GMT</pubDate></item><item><title>ralf commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Your download is broken.
  
Exception Details: NHibernate.QueryException: in expected: f [from Feed f where f.Section.Id = :sectionId]
  
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment7</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment7</guid><pubDate>Thu, 29 Mar 2007 06:14:51 GMT</pubDate></item><item><title>Chris Vickerson commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>I do appologize in advance if this information is in this first webcast - I'll watch it later tonight.  I've been contemplating using RhinoMocks for quite some time - to finally learn how to incorporate mocking into our process of developing.  When I approach others I work with I always get hammered with reasons not to use mock objects.  One that keeps coming up is how to mock frameworks such as Windows Workflow Foundation.  Would you consider covering the topic of mocking large existing frameworks (eg. ASP .Net or WWF)?
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment6</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment6</guid><pubDate>Thu, 29 Mar 2007 00:50:24 GMT</pubDate></item><item><title>Adam Tybor commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Very nice! I can't wait to see more.
  
  
If you continue to do these one suggestion would be to try and include, like you did with Do() and LastCall.Constraints, practical examples of how to take advantage of all magic in RhinoMocks.
  
  
As always, nice work.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment5</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment5</guid><pubDate>Wed, 28 Mar 2007 23:53:35 GMT</pubDate></item><item><title>Ayende Rahien commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Please try now, it works.
  
@Leo, sorry about the error, I turned detailed errors on so I could figure out issues with the site.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment4</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment4</guid><pubDate>Wed, 28 Mar 2007 22:02:32 GMT</pubDate></item><item><title>Leo commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Wow atleast hide the detailed error page !! 
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment3</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment3</guid><pubDate>Wed, 28 Mar 2007 21:50:49 GMT</pubDate></item><item><title>Adam commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Same for me...
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment2</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment2</guid><pubDate>Wed, 28 Mar 2007 21:46:39 GMT</pubDate></item><item><title>cristian commented on Hibernating Rhinos - Episode #1: Rhino Mocks 101</title><description>Would you mind checking the download? It doesn't seem to work.
</description><link>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment1</link><guid>http://ayende.com/2265/hibernating-rhinos-episode-1-rhino-mocks-101#comment1</guid><pubDate>Wed, 28 Mar 2007 21:42:54 GMT</pubDate></item></channel></rss>