<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: nMock vs RhinoMocks</title>
	<atom:link href="http://blog.robbowley.net/2008/07/09/nmock-vs-rhinomocks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robbowley.net/2008/07/09/nmock-vs-rhinomocks/</link>
	<description>adventures in extreme programming</description>
	<lastBuildDate>Wed, 25 Aug 2010 06:23:32 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: rob</title>
		<link>http://blog.robbowley.net/2008/07/09/nmock-vs-rhinomocks/comment-page-1/#comment-156</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Sun, 18 Jan 2009 16:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://test.robbowley.net/?p=9#comment-156</guid>
		<description>I was talking about nMock. This article was written pre NMock2 so I guess it&#039;s now irrelevant.</description>
		<content:encoded><![CDATA[<p>I was talking about nMock. This article was written pre NMock2 so I guess it&#8217;s now irrelevant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Kazyrevich</title>
		<link>http://blog.robbowley.net/2008/07/09/nmock-vs-rhinomocks/comment-page-1/#comment-155</link>
		<dc:creator>Andrew Kazyrevich</dc:creator>
		<pubDate>Sun, 18 Jan 2009 15:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://test.robbowley.net/?p=9#comment-155</guid>
		<description>If you&#039;re talking about NMock2 (not nMock) then event firing *is* there.

The test for the case described by Neil (http://blog.gravityfree.ca/2007/03/raising-events-in-nmock-20.html, I&#039;ve put a comment there as well) would go as

[Test]
public void ShouldLoadAccountsIntoViewOnPageLoad()
{
    var mockery = new Mockery();
    var view = (IAccountSummaryView)mockery.NewMock(typeof(IAccountSummaryView));
    Expect.Once.On(view).EventAdd(&quot;Load&quot;);
    Expect.Once.On(view).Method(&quot;Display&quot;).With(Is.Anything);
    
    var presenter = new AccountSummaryPresenter(view);
    Fire.Event(&quot;Load&quot;).On(view).With(null, null);

    mockery.VerifyAllExpectationsHaveBeenMet();
}

On a general note - unfortunately, nMock is no longer supported. Those of us who really like the expectations DSL and syntax of nMock are probably better off moving over to NMock2.

Or choose Rhino Mocks or Moq or Typemock Isolator :)


Cheers,
Andrew</description>
		<content:encoded><![CDATA[<p>If you&#8217;re talking about NMock2 (not nMock) then event firing *is* there.</p>
<p>The test for the case described by Neil (<a href="http://blog.gravityfree.ca/2007/03/raising-events-in-nmock-20.html" rel="nofollow">http://blog.gravityfree.ca/2007/03/raising-events-in-nmock-20.html</a>, I&#8217;ve put a comment there as well) would go as</p>
<p>[Test]<br />
public void ShouldLoadAccountsIntoViewOnPageLoad()<br />
{<br />
    var mockery = new Mockery();<br />
    var view = (IAccountSummaryView)mockery.NewMock(typeof(IAccountSummaryView));<br />
    Expect.Once.On(view).EventAdd(&#8221;Load&#8221;);<br />
    Expect.Once.On(view).Method(&#8221;Display&#8221;).With(Is.Anything);</p>
<p>    var presenter = new AccountSummaryPresenter(view);<br />
    Fire.Event(&#8221;Load&#8221;).On(view).With(null, null);</p>
<p>    mockery.VerifyAllExpectationsHaveBeenMet();<br />
}</p>
<p>On a general note &#8211; unfortunately, nMock is no longer supported. Those of us who really like the expectations DSL and syntax of nMock are probably better off moving over to NMock2.</p>
<p>Or choose Rhino Mocks or Moq or Typemock Isolator <img src='http://blog.robbowley.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers,<br />
Andrew</p>
]]></content:encoded>
	</item>
</channel>
</rss>
