tag:blogger.com,1999:blog-5139324531203768210.comments2008-12-03T06:21:14.138-08:00Michael Braude's Technical BlogMichael J. Braudehttp://www.blogger.com/profile/03925868482949362877mikebraude@gmail.comBlogger3125tag:blogger.com,1999:blog-5139324531203768210.post-66900179165487884172008-12-03T06:21:00.000-08:002008-12-03T06:21:00.000-08:002008-12-03T06:21:00.000-08:00MockFactory allows overriding the behavior of spec...MockFactory allows overriding the behavior of specific mocks via the Create{T}(MockBehavior) overload.<BR/><BR/>PartialMocks from Rhino are the same as specifying CallBase = true in Moq:<BR/><BR/>var mockFactory = new MockFactory(MockBehavior.Strict) { CallBase = true };<BR/><BR/>// or for a single mock:<BR/>var mock = new Mock{IFoo} { CallBase = true };<BR/><BR/>Ordered results can be achieved using Callbacks (as they can run before and/or after the Returns call) and returning with a lazy-evaluated delegate:<BR/><BR/>int count = 0;<BR/><BR/>mock.Expect(x =&gt; x.Increment())<BR/> .Callback(() =&gt; count++)<BR/> .Returns(count);<BR/> // you can specify another .Callback after the returns here.<BR/><BR/>That said, we&#39;re looking into making mock call sequencing easier...<BR/><BR/>(replaced &lt; &gt; with { } as the sanitizer isn&#39;t letting me write those)kzuhttp://www.blogger.com/profile/13889276248119153071noreply@blogger.comtag:blogger.com,1999:blog-5139324531203768210.post-83238776074893609082008-12-02T13:38:00.000-08:002008-12-02T13:38:00.000-08:002008-12-02T13:38:00.000-08:00There is a better way. Look at the GetRootElementT...There is a better way. Look at the GetRootElementType() method I have in Spackle.NET:<BR/><BR/>http://www.codeplex.com/SpackleNet/<BR/><BR/>This makes it very easy to find the &quot;root&quot; - i.e. boolean&amp;&#39;s root is boolean. Then this should work:<BR/><BR/>typeof(bool).GetRootElementType() == typeof(bool).MakeByRefType().GetRootElementType()<BR/><BR/>Regards,<BR/>JasonJason Bockhttp://www.jasonbock.netnoreply@blogger.comtag:blogger.com,1999:blog-5139324531203768210.post-86870693275511686532008-11-19T01:46:00.000-08:002008-11-19T01:46:00.000-08:002008-11-19T01:46:00.000-08:00Hi,I wrote about using Isolator with auto deploy" ...Hi,<BR/><BR/>I wrote about <A HREF="http://blog.typemock.com/2008/11/using-isolator-auto-deploy.html" REL="nofollow">using Isolator with auto deploy"</A> to solve the problem of installing it on a machine. You still need a license for Isolator to run Isolator tests.<BR/><BR/>p.s. We don't hijack the CLR. We use the profiler API to hook into CLR events. After we've done with them, we give them back :)<BR/><BR/>Gil Zilberfeld<BR/><A HREF="http://www.typemock.com" REL="nofollow">Typemock</A>Gil Zilberfeldhttp://www.blogger.com/profile/18210181375618736629noreply@blogger.com