Re: [RhinoMocks] Query Related to LastCall.

2010-10-06 Thread Ayende Rahien
foo.GetArgumentsForCallsMadeOn(x=>x.End()).Count == 1

On Wed, Oct 6, 2010 at 1:22 PM, k0v1d pa9d3y  wrote:

> How do i make sure that after the particular method called up no other
> method/ property setter should be called on the same object.
>
> Let say I have a method which has three methods,
>
> Start()
> DoSomeProcess1()
> DoSomeProcess2()
> DoSomeProcess1()
> //Some property settings...
> .
> End(),
>
> I want to make sure that End() should always be executed at last, no other
> method should be executed once End gets executed?
>
> How can I achieve this using Rhinomock();
>
> Thanks in advance!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] Mocking a huge interface

2010-08-31 Thread Ayende Rahien
This is a known issue with VS 2008, I don't know if it is still there in VS
2010

On Tue, Aug 24, 2010 at 3:27 PM, A  wrote:

> I want to mock a third party interface that contains approx. 170
> public properties and methods. Executing the test (without debugging)
> takes up to 5 seconds, but when debugging the mock instantiation step
> takes couple of minutes.
>
> Is there any workaround to somehow reduce the time of execution?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] VS2010

2010-08-28 Thread Ayende Rahien
No

On Sun, Aug 29, 2010 at 9:20 AM, Iain Waddell wrote:

>
> Anyone care if I move Rhino up to VS2010?
>>
>
> Will this affect those of us who don't work with the source?
>
> I'm still on VS2008 /.NET 3.5SP1 but use the released builds.
>
> Iain
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] Re: Value Equality and Default Equals

2010-06-21 Thread Ayende Rahien
No, it is:
Rhino Mocks should provide an overload with IEqualityComparer

On Mon, Jun 21, 2010 at 9:38 PM, Stephen Bohlen  wrote:

> OK, I think I get it.  Is this (then) really a bug report about "Rhino
> Mocks doesn't respect EQUALS overrides when performing its verification" ?
>
>
> Steve Bohlen
> sboh...@gmail.com
> http://blog.unhandled-exceptions.com
> http://twitter.com/sbohlen
>
>
>
> On Mon, Jun 21, 2010 at 2:35 PM, Dewy wrote:
>
>> I don't want to override Equals in my object, I want to override the
>> way Rhino mocks is implementing the equals
>>
>> On Jun 21, 7:10 pm, Tim Barcz  wrote:
>> > Can you just override Equals() in whatever object type is returned
>> > by NewObjectUnderTest().WithProperty1("value1").Build();
>> >
>> > The reason reference equality is used is that you've likely not
>> overridden
>> > Equals method.  If you can tell .Net and by extension Rhino when two
>> objects
>> > are equal, the call below should work as you would like.
>> >
>> > On Mon, Jun 21, 2010 at 11:42 AM, Dewy > >wrote:
>> >
>> >
>> >
>> > > This is the thing, I don't want the objects to act different at all. I
>> > > want the objects to always use one type of equality, but using Rhino
>> > > Mocks as is will use refernce equality by default.
>> > > So, say I have a Mock service MyService and I can say something like:
>> >
>> > > [Test]
>> > > public void MyTest()
>> > > {
>> > >var objectUnderTest =
>> > > NewObjectUnderTest().WithProperty1("value1").Build(); // Using a
>> > > builder
>> >
>> > >objectUnderTest.MyService = MockMyService; // Setup in TestSetup
>> >
>> > >MockMyService.Expect(() => s =>
>> > > s.SomeMethodCall(objectUnderTest));
>> >
>> > >// do test
>> > >objectUnderTest.TestMethod(); // Changes Property1 to 'value2'
>> > > then calls SomeMethodCall
>> > > }
>> >
>> > > So, doing it this way works, but doesn't really tell me anything. What
>> > > I really want to do is something like:
>> >
>> > > [Test]
>> > > public void MyTest()
>> > > {
>> > >var objectUnderTest =
>> > > NewObjectUnderTest().WithProperty1("value1").Build(); // Using a
>> > > builder
>> >
>> > >objectUnderTest.MyService = MockMyService; // Setup in TestSetup
>> >
>> > >MockMyService.Expect(() => s =>
>> > >
>> s.SomeMethodCall(NewObjectUnderTest().WithProperty1("value2").Build()));
>> >
>> > >// do test
>> > >objectUnderTest.TestMethod();
>> > > }
>> >
>> > > And then have Rhino mocks use my version of equals but I don't want to
>> > > have to say use this contraint all over the place.
>> > > Does this make sense?
>> >
>> > > So, what I am looking for is way to change the default implementation
>> > > of equals within Rhino mocks, such that I don't have to change a line
>> > > in my tests, maybe in my test setups.
>> >
>> > > On Jun 21, 3:44 pm, Stephen Bohlen  wrote:
>> > > > I admit to some confusion about why you're trying to have objects
>> behave
>> > > one
>> > > > way (with value equality) when under test but not when in production
>> > > > (presumably reverting to their default reference equality).  This
>> seems
>> > > to
>> > > > me to be at best confusing and worst rendering your tests mostly
>> useless.
>> >
>> > > > Can you expand a bit on the context of why you would even want this
>> in
>> > > your
>> > > > tests (as I am very curious)?
>> >
>> > > > Steve Bohlen
>> > > > sboh...@gmail.comhttp://blog.unhandled-exceptions.comhttp://
>> > > twitter.com/sbohlen
>> >
>> > > > On Mon, Jun 21, 2010 at 8:54 AM, Dewy <
>> anthony.dewhi...@googlemail.com
>> > > >wrote:
>> >
>> > > > > In our tests we use Value Equality on our objects to check that
>> they
>> > > > > have the same values rather than being the same object.
>> > > > > When we set up expectations we have gotten around this by making
>> all
>> > > > > our objects be Value Objects (via base class and override of
>> Equals)
>> > > > > which we don't really want in the production code.
>> >
>> > > > > I see that there is a way to get around this by creating new
>> > > > > constraints where we can do as we see fit.
>> > > > > What I am really looking for is a way to override ALL equality for
>> all
>> > > > > mocks, such that we don't have to say on every Expect(...) that we
>> > > > > want to use a custom constraint, say some way to override this
>> when we
>> > > > > first create the MockRepository?
>> > > > > Is there a way already to do this?
>> >
>> > > > > --
>> > > > > You received this message because you are subscribed to the Google
>> > > Groups
>> > > > > "Rhino.Mocks" group.
>> > > > > To post to this group, send email to rhinomo...@googlegroups.com.
>> > > > > To unsubscribe from this group, send email to
>> > > > > rhinomocks+unsubscr...@googlegroups.com
>> 
>> >
>> > > 
>> 
>> >
>> >
>> > > > > .
>> > > > > For more options, visit this group at
>> > > > >http://groups.google.com/group/rhinomocks?hl=en.
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > >

Re: [RhinoMocks] IgnoreParameters() of Action<>

2010-03-23 Thread Ayende Rahien
IgnoreArguments is complete, you can't ignore only partially.
You can use something like constraints to do this.

On Tue, Mar 23, 2010 at 12:08 PM, James L  wrote:

> I'd like to specify that a method will be called, but I don't care
> about the arguments.  One of the arguments is Action, which
> doesn't take null.  How can I express this without creating
> meaningless test code?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] Re: Rhino Mocks 4.0

2010-03-03 Thread Ayende Rahien
Yes, implement one feature at a time :-)
More seriously, we need someone to step into the plate and take one of the
features and implement this.
Make a big noise about that, get more contribs.
Rince, repeat

On Wed, Mar 3, 2010 at 3:35 PM, smnbss  wrote:

> September 09
> http://ayende.com/Blog/archive/2009/09/03/planning-for-rhino-mocks-4.0.aspx
> Do we have a roadmap of what we would like to achieve?
>
> I Saw this
> http://nhprof.uservoice.com/forums/28152-rhino-mocks-4-0
>
> I'm quite new toRhino.Mocks so I've really no idea where to start
> from, but I'll try to see if there's
> something easy I can implement
>
>
>
> On Mar 3, 2:58 pm, bill richards  wrote:
> > I would love to get in on this, being a real proponent of the Rhino
> > framework, and with so many great ideas (for example
> > [ObsoleteAttribute] on all the Record/Replay functionality, hehe), but
> > unfortunately I cannot foresee myself having much time to dedicate to
> > this over the next 12-18 months
> >
> > On Mar 3, 2:53 pm, Tim Barcz  wrote:
> >
> >
> >
> > > I'll step in here...
> >
> > > There's been some chatter behind the scenes...
> >
> > > Two weeks ago at MVP summit I created a remote branch in Git for 4.0.
>  I'd
> > > like to see some movement here but I'd like to pull in some help for
> this
> > > and see who is willing to contribute assistance to the project.
> >
> > > I hesitate because I'm not having the time to dedicate that I'd like
> to.
> >
> > > Are there others out there who would be wanting to assist?
> >
> > > Tim
> >
> > > On Mon, Mar 1, 2010 at 5:21 AM, smnbss  wrote:
> > > > Guys, how is this going?
> > > > Is there any release date for Rhino Mocks 4.0?
> >
> > > > I haven't heard about 4.0 for a long time
> >
> > > > Simone
> >
> > > > --
> > > > You received this message because you are subscribed to the Google
> Groups
> > > > "Rhino.Mocks" group.
> > > > To post to this group, send email to rhinomo...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > rhinomocks+unsubscr...@googlegroups.com
> 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/rhinomocks?hl=en.
> >
> > > --
> > > Tim Barcz
> > > Microsoft C# MVP
> > > Microsoft ASPInsiderhttp://timbarcz.devlicio.ushttp://
> www.twitter.com/timbarcz-Hide quoted text -
> >
> > > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] Re: how to repeat multiple expectation

2010-03-03 Thread Ayende Rahien
Um, for loop?

On Wed, Mar 3, 2010 at 1:09 PM, Diego Guidi  wrote:

> > Expect.Call(...).Repeat.Times(100); ?
>
> I need to repeat a sequence of Expect.Call, so standard methods like
> the one you've posted looks not useful to me... or am I wrong?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] how to repeat multiple expectation

2010-03-03 Thread Ayende Rahien
Expect.Call(...).Repeat.Times(100); ?

On Wed, Mar 3, 2010 at 1:04 PM, Diego Guidi  wrote:

> I have a code like this
>
> With.Mock(repo).Expecting(() =>
> {
> Expect.Call(mock.F1()).Return(true);
> Expect.Call(mock.A()).IgnoreArguments().Return(-1); // actually a long
> instruction
> Expect.Call(mock.B()).IgnoreArguments().Return(-1); // even more long :
> (
> Expect.Call(mock.A()).IgnoreArguments().Return(-1);
> Expect.Call(mock.B()).IgnoreArguments().Return(-1);
> Expect.Call(mock.A()).IgnoreArguments().Return(-1);
> Expect.Call(mock.B()).IgnoreArguments().Return(-1);
> Expect.Call(mock.A()).IgnoreArguments().Return(-1);
> Expect.Call(mock.B()).IgnoreArguments().Return(-1);
> Expect.Call(mock.A()).IgnoreArguments().Return(-1);
> Expect.Call(mock.B()).IgnoreArguments().Return(-1);
> })...
>
> A then B are repeated multiple times (actually 10), so my expectations
> section is long more than 100 lines of code.
>
> IMethodOptions.Repeat looks unusable because i need to repeat the
> sequence A -> B and not a single call.
> Looks I need something like:
>
> var a  = Expect.Call(mock.A()).IgnoreArguments().Return(-1);
> var b = Expect.Call(mock.B()).IgnoreArguments().Return(-1);
> a.Then.b.Repeat.Times(10);
>
> Any suggestion? Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] Test passes (which it shouldn't) but fails in debug mode when stepping though the code

2010-01-11 Thread Ayende Rahien
you are probably hitting the ErrorMessages property in the watch window,
triggering this

On Mon, Jan 11, 2010 at 10:33 AM, devghost  wrote:

> I got a test that passes (which it shouldn't, as far as I can see)
> except when I run it in debug mode and step through the code. When I
> step through the code the test fails.
>
> This is what the test looks like:
>
>Protected Overrides Sub Context()
>mockedView = MockRepository.GenerateMock(Of
> IObjectSelectionView)()
>stubbedDomain = MockRepository.GenerateStub(Of
> ObjectSelectionDomain)()
>End Sub
>
> _
>Public Sub It_should_return_a_valid_validationresult()
>' Arrange
>stubbedDomain.Stub(Function(e As ObjectSelectionDomain)
> e.GetObjects(Nothing, Nothing)).IgnoreArguments().Return(New List(Of
> ObjectDto)).OutRef(New ValidationResult("Error!"))
>mockedView.Expect(Function(x) x.ErrorMessages).Repeat.Never()
>
>' Act
>Dim presenter As ObjectSelectionPresenter = New
> ObjectSelectionPresenter(mockedView, stubbedDomain)
>presenter.GetObjects()
>
>' Assert
>mockedView.AssertWasNotCalled(Function(x) x.ErrorMessages)
>
>End Sub
>
> The stub seems to work OK, when I step throught the code. The
> ValidationResult is correctly outref:ing the "Error!" message. And
> when the ValidationResult is returning an error message the
> mockedView.ErrorMessages is called.
>
> The thing is that since I am expecting mockedView.ErrorMessages never
> to be called, I want the test to fail. However the test only fails in
> debug mode + when I step through the code. Not when running the tests
> as "normal" or via command line using NUnit.
>
> Am I doing something awkward with RhinoMocks?
>
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group.

To post to this group, send email to rhinomo...@googlegroups.com.

To unsubscribe from this group, send email to rhinomocks+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.



Re: [RhinoMocks] Re: Rhino Mocks, Documentation samples

2009-12-09 Thread Ayende Rahien
I merged your changed with my copy on github, thanks!

On Tue, Dec 8, 2009 at 7:59 PM, Fabien Arcellier  wrote:

> Hi,
>
> I push the Documentation directory on github.
>
>
> http://github.com/FabienArcellier/rhino-mocks/tree/master/Rhino.Mocks.GettingStarted/Documentation/
>
> I try to write every test in double, one following the documentation
> aspect, one following the AAA pattern.
>
> Feel free to do any remark about the result.
>
> Do you think I'd have to separate classic code and code following the
> AAA pattern in two solution ?
>
> Regards,
> Fabien Arcellier
>
>
> On Dec 1, 7:23 pm, Fabien Arcellier 
> wrote:
> > I only took the existant exemple to begin. At origin, this solution
> > has been done to learn RhinoMocks using from the documentation.
> > I read the wiki a little bit more. The documentation core is very
> > good. He just miss a training package.
> >
> > It'd be great to finish it and publish the full documentation with
> > valid exemple on a website like codeproject.
> >
> > It could be interesting to duplicate every methods with the classical
> > method and short method (AAA, record-replay, ...)
> > I'll try to do that.
> >
> > Sorry Tim for the time I need to commit my work on github. I have some
> > issue to use it.
> >
> > Tortoisegit displays everytime an authentification window during the
> > push. I didn't find any resource on the net for this issue.
> > I send a ticket to Github support.
> http://support.github.com/discussions/repos/2054-authentification-on-...
> >
> > Fabien
> >
> > On 30 nov, 01:35, Tim Barcz  wrote:
> >
> >
> >
> > > This is underway. I think support for record/replay and AAA will be
> great
> >
> > > Tim
> >
> > > On Sun, Nov 29, 2009 at 7:28 PM, Stephen Price 
> wrote:
> > > > This is brilliant. Just was I was looking for.
> >
> > > > At a cursory glance, I notice that most of the tests seem to be
> Record/Play
> > > > formatting rather than AAA. Still, it's great. All the unit tests
> pass too!
> > > > :)
> >
> > > > If this can be checked into the Rhinomocks source and made available
> via
> > > > the documentation, as well as updated with examples of AAA style
> (perhaps
> > > > the existing unit tests can have an example of each in them?) that
> would be
> > > > fantastic for people learning Rhinomocks.
> >
> > > > many thanks!
> > > > Stephen
> >
> > > > On Mon, Nov 30, 2009 at 12:21 AM, Fabien Arcellier <
> > > > fabien.arcell...@gmail.com> wrote:
> >
> > > >> Hello,
> >
> > > >> This visual studio solution contains samples for RhinoMock :
> >
> > > >>
> http://groups.google.com/group/rhinomocks/web/Documentation-Samples-R...
> >
> > > >> It contains exemple taken from the documentation :
> > > >>http://www.ayende.com/wiki/Rhino+Mocks+Documentation.ashx
> >
> > > >> For each one, I wrote the minimum implementation to compile and pass
> > > >> the test.
> >
> > > >> Indeed, lot of exemples written in the documentation are taken from
> > > >> real project. There isn't any means to use them except to rewrite
> the
> > > >> implementation.
> > > >> It's really time consuming for a developer who'd like discover this
> > > >> library.
> >
> > > >> I think it's very interesting to have such of things to save time
> for
> > > >> developers who'd like to experiments.
> >
> > > >> Perhaps someone more experimented than me can correct some mistakes
> > > >> and put in the documentation summary page.
> >
> > > >> The library used to compile the project are in the subdirectory lib
> > > >> with license. Currently, it's :
> > > >> - nunit 2.5.2
> > > >> - RhinoMock 3.6
> >
> > > >> Remarks and difference with the documentation :
> >
> > > >> 01-RhinoMocksIntroduction:
> > > >>  RhinoMocksIntroductionTest.cs
> > > >>  line 34 : You need to prefix the second param by ExpectedMessage=,
> > > >> required by Nunit 2.5.2
> >
> > > >> 04-RhinoMocksOrderedUnordered
> > > >>  RhinoMocksOrderedUnorderedTest.cs
> > > >>  line 73 : Dispose is a method without return. Implementation change
> > > >> to be conform.
> > > >>  line 59 : Whatever the implementation, I don't succeed to pass this
> > > >> test. I tried by deleting the Unordered calling and these methods
> > > >> calling, it works fine.
> > > >>Exception triggered :
> >
> > > >>
> RhinoMocksIntroduction.RhinoMocksOrderedUnorderedTest.MovingFundsUsingTrans
> actions:
> > > >>  Rhino.Mocks.Exceptions.ExpectationViolationException :
> > > >> IDatabaseManager.Dispose(); Expected #0, Actual #1.
> >
> > > >> 06-RhinoMocksEvents
> > > >>  SubscribeToEventTest.cs
> > > >>  line 44 : I changed the implementation of test
> > > >> VerifyingThatEventWasAttached_AAA. I am not very sure it's correct.
> If
> > > >> someone could verify.
> >
> > > >> 07-RhinoMocksIEventRaiser :
> > > >>  line 46 : We needs 2 params to raise an event
> >
> > > >> 08-RhinoMocksProperties
> > > >>  RhinoMocksPropertiesTest.cs
> > > >>  Line 50 : Capacity property doesn't implement in IList, I used
> > > >> ArrayList as a Mocking Class
> >
> > 

Re: [RhinoMocks] Mocking internals without InternalVisibleTo ?

2009-12-06 Thread Ayende Rahien
The CLR does not allow it, so no

On Sun, Dec 6, 2009 at 12:32 PM, izik.shmulew...@gmail.com <
izik.shmulew...@gmail.com> wrote:

> Is there a way to mock internal types/methods without using the
> InternalVisibleTo attribute ?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.




Re: [RhinoMocks] Re: Documentation Updates

2009-11-30 Thread Ayende Rahien
Sorry, I wasn't following up on this thread.
I am more than happy to provide people with access to the site so they can
add the documentation.

On Tue, Dec 1, 2009 at 3:21 AM, Ben M  wrote:

> any update to this Oren?  It sure would be nice to see some doc'n with
> the newer syntax...
>
> On Nov 18, 12:47 am, Ayende Rahien  wrote:
> > :-)
> > More to the point, I would like to move all the documentation to:
> http://hibernatingrhinos.com/open-source/rhino-mocks
> >
> > People find wikis hard to use, my hope is that by providing WLW support,
> we
> > can get better docs.
> >
> > On Wed, Nov 18, 2009 at 10:42 AM, Alex McMahon 
> wrote:
> > > to pre-empt Ayende's usual reply... A few of those pages and certainly
> all
> > > the real documentation is a wiki, so any of us can update it. The
> sample
> > > solution would indeed be a good idea.
> >
> > > 2009/11/17 Chris Missal 
> >
> > > As it has been pointed in other threads. People appear to be looking
> for RM
> > >> documentation, but finding old information. It's hard to get Google to
> point
> > >> to a new page first, but maybe we can convince Ayende to update those
> pages
> > >> that are showing up high? :) Here are some old pages that come up in
> > >> searches that could point users to more current info:
> >
> > >>http://www.ayende.com/projects/rhino-mocks/documentation.aspx
> > >>http://www.ayende.com/wiki/Rhino+Mocks+Documentation.ashx
> >
> > >>http://ayende.com/Blog/archive/2005/08/16/UpdatedRhinoMocksDocumentat.
> ..
> > >>http://www.ayende.com/wiki/Rhino+Mocks.ashx(this<http://www.ayende.com/wiki/Rhino+Mocks.ashx%28this>one
> > >> is ok, but could
> > >> use a few updates of links)
> >
> > >> --
> > >> Chris Missal
> > >>http://chrismissal.lostechies.com/
> >
> > >> --
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "Rhino.Mocks" group.>> To post to this group, send email
> torhinomo...@googlegroups.com.
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/rhinomocks?hl=.
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Rhino.Mocks" group.> To post to this group, send email
> torhinomo...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/rhinomocks?hl=.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhinomocks+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.




Re: [RhinoMocks] Documentation Updates

2009-11-18 Thread Ayende Rahien
:-)
More to the point, I would like to move all the documentation to:
http://hibernatingrhinos.com/open-source/rhino-mocks

People find wikis hard to use, my hope is that by providing WLW support, we
can get better docs.

On Wed, Nov 18, 2009 at 10:42 AM, Alex McMahon  wrote:

> to pre-empt Ayende's usual reply... A few of those pages and certainly all
> the real documentation is a wiki, so any of us can update it. The sample
> solution would indeed be a good idea.
>
> 2009/11/17 Chris Missal 
>
> As it has been pointed in other threads. People appear to be looking for RM
>> documentation, but finding old information. It's hard to get Google to point
>> to a new page first, but maybe we can convince Ayende to update those pages
>> that are showing up high? :) Here are some old pages that come up in
>> searches that could point users to more current info:
>>
>> http://www.ayende.com/projects/rhino-mocks/documentation.aspx
>> http://www.ayende.com/wiki/Rhino+Mocks+Documentation.ashx
>>
>> http://ayende.com/Blog/archive/2005/08/16/UpdatedRhinoMocksDocumentation.aspx
>> http://www.ayende.com/wiki/Rhino+Mocks.ashx (this one is ok, but could
>> use a few updates of links)
>>
>>
>> --
>> Chris Missal
>> http://chrismissal.lostechies.com/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Rhino.Mocks" group.
>> To post to this group, send email to rhinomo...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rhinomocks?hl=.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to rhinomo...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=.
>

--

You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomo...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=.




[RhinoMocks] Re: Ordering behaviour changed in 3.6

2009-10-14 Thread Ayende Rahien
Yes, this is an known breaking change in 3.6

On Wed, Oct 14, 2009 at 12:00 PM, dansm77  wrote:

>
> Today I upgraded to Rhino Mocks 3.6, and a series of our tests now
> fail. Here is a simple example that succeeded with 3.5, and fails with
> 3.6.
>
> [Test]
> public void OrderedTest()
> {
>var mockFoo = MockRepository.GenerateMock();
>
>using (mockFoo.GetMockRepository().Ordered())
>{
>mockFoo.Expect(x => x.Value).Return("abc");
>mockFoo.Expect(x => x.Value).Return("xyz");
>}
>
>Assert.That(mockFoo.Value, Is.EqualTo("abc"));
>Assert.That(mockFoo.Value, Is.EqualTo("xyz"));
> }
>
> public interface IFoo
> {
>string Value
>{
>get;
>}
> }
>
> The last assert fails. This is also the case with the old style, i.e.
> using an explicit MockRepository instance, and using the old static
> method syntax.
>
> If I put a "Repeat.Once()" on my expectations, i.e. "mockFoo.Expect(x
> => x.Value).Return("abc").Repeat.Once()", it works. Now we will have
> to go through our tests and fix them if we want the lastest version.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Adding a delay using Mock

2009-10-01 Thread Ayende Rahien
WhenCalled( invocation => Thread.Sleep(100));

On Thu, Oct 1, 2009 at 12:28 PM, Shrihari Devji wrote:

>
> Hi
>   I am using a Rhino mock to mock a WCF service. I want to test my
> client code when there is a more than expected delay from the server.
> Is there a way using which I can introduce a delay using rhino mock to
> simulate the scenario?
> It will help me to test my code.
>
> Thanks in Advance
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: mocking XmlNode

2009-09-16 Thread Ayende Rahien
Instead of trying to mock it, create an XmlNode using the usual mechanism
(XmlDocument) run the code under test.
Afterward, assert on the XmlNode values.

On Thu, Sep 17, 2009 at 12:31 AM, deltaoo
wrote:

>
> Hi
> How can I mock XmlNode?
> Say I have the following..
>
> Public class someclass (XmlNode an_xml_node ){
> …..
> }
>
> XmlNode is an abstract class, but I can’t mock it cos the constructors
> are internal (I think)
>
> I can’t change the constructor, and need a mock to test the methods
> were called.
>
> … what options are there…
>
> Thanx
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] CI builds

2009-09-11 Thread Ayende Rahien
Rhino Mocks now have a CI build site setup, you can always download the
latest from:http://builds.hibernatingrhinos.com/builds/Rhino-Mocks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Logic in constructors

2009-09-11 Thread Ayende Rahien
You cannot intercept virtual methods calls in the ctor.
The reason for that is that this is happening because the proxy ctor runs
and set up things.

On Fri, Sep 11, 2009 at 3:04 PM, TJA  wrote:

>
> Hello,
>
> I have to test a class that has some logic in its default constructor.
>
> public abstract class Translation : ITranslation
> {
> public Translation()
> {
>this.Language = new Language();
>this.IsInitialTranslation = true;
>this.Enabled = true;
> }
> ...
> ..
> .
> }
>
> if in my test i do the following
>
> translation = MockRepository.GenerateMock();
> Assert.IsTrue(translation.Enabled);
>
>
> but the test fails because Enabled is always falls. Did I missed
> something ?
>
> Thanks for your help.
>
> TJA
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: NullReferenceException with RecursiveStub

2009-09-10 Thread Ayende Rahien
But that should be fixed with recursive mocks.

On Fri, Sep 11, 2009 at 1:05 AM, Tim Barcz  wrote:

> You need to set up an object for the "Identity" object.
>
> right now, x.Identity is null, so a call to x.Identity.Name is of course
> Null
>
> On Thu, Sep 10, 2009 at 2:38 PM, kurtharriger wrote:
>
>>
>>
>> I was trying to use the recursive mock syntax and kept getting
>> NullReferenceException error.
>> Here is a failing test - same as CanUseRecursiveMockSimpler() but
>> using Stub instead.
>>
>> [Test]
>>public void CanUseRecursiveStubSimpler()
>>{
>>var mockService = MockRepository.GenerateStub
>> ();
>>
>>mockService.Expect(x => x.Identity.Name).Return("foo");
>>
>>Assert.AreEqual("foo", mockService.Identity.Name);
>>}
>>
>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: GIT for RhinoMocks repository?

2009-09-10 Thread Ayende Rahien
Yeah,Tim & I just had this ping pong between us.
He fixed some things, asked me to pull, and I pulled them into mine copy and
push them to github.

On Thu, Sep 10, 2009 at 7:34 AM, Adam Dymitruk  wrote:

>
> pull requests?
>
> On Tue, Sep 8, 2009 at 11:50 AM, Ayende Rahien wrote:
> > I think we will take this to rhino-tools, but ideally I would like to see
> us
> > managing things using pull requests.
> >
> > On Tue, Sep 8, 2009 at 9:48 PM, Tim Barcz  wrote:
> >>
> >> I committed some code (one cmall change with four test cases) on
> Saturday
> >> to sourceforge...did that by any chance make it in, or do I need to
> switch
> >> over to GIT and submit push there?
> >>
> >>
> >> On Tue, Sep 8, 2009 at 1:46 PM, Ayende Rahien 
> wrote:
> >>>
> >>> Yes
> >>>
> >>> On Tue, Sep 8, 2009 at 9:41 PM, Tim Barcz  wrote:
> >>>>
> >>>> Should we be looking and pulling source from Git now?
> >>>>
> >>>> On Tue, Sep 8, 2009 at 1:25 PM, Ayende Rahien 
> wrote:
> >>>>>
> >>>>> I want to move the entire suite to Git, yes.
> >>>>> Currently the SVN version has a patch that the GIT version has as
> well,
> >>>>> but the 3.6 was released from the GIT version.
> >>>>> On Tue, Sep 8, 2009 at 9:11 PM, Tim Barcz 
> wrote:
> >>>>>>
> >>>>>> I know Oren said he was up for it.
> >>>>>>
> >>>>>> I'm getting into Git on my own and would like see us take a spin
> down
> >>>>>> that road.
> >>>>>>
> >>>>>> On Tue, Sep 8, 2009 at 1:00 PM, Adam Dymitruk 
> >>>>>> wrote:
> >>>>>>>
> >>>>>>> I think Tim Barcz was asking about this in the 4.0 thread. Was the
> >>>>>>> silence an indication of 'no'?
> >>>>>>>
> >>>>>>> --
> >>>>>>> Adam
> >>>>>>>
> >>>>>>> http://twitter.com/adymitruk/
> >>>>>>> http://www.agilevancouver.net/
> >>>>>>> http://altnetvancouver.ning.com/
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Tim Barcz
> >>>>>> Microsoft ASPInsider
> >>>>>> http://timbarcz.devlicio.us
> >>>>>> http://www.twitter.com/timbarcz
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Tim Barcz
> >>>> Microsoft ASPInsider
> >>>> http://timbarcz.devlicio.us
> >>>> http://www.twitter.com/timbarcz
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> Tim Barcz
> >> Microsoft ASPInsider
> >> http://timbarcz.devlicio.us
> >> http://www.twitter.com/timbarcz
> >>
> >>
> >>
> >
> >
> > >
> >
>
>
>
> --
> Adam
>
> http://twitter.com/adymitruk/
> http://www.agilevancouver.net/
> http://altnetvancouver.ning.com/
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: I'm not sure how to do this, please help (again)!

2009-09-09 Thread Ayende Rahien
No, it is not

On Wed, Sep 9, 2009 at 9:47 PM, bill richards
wrote:

>
> Is it possible to mock extension methods using RM v 3.5?
>
> It seems that my problem revolves around the fact
> that .RegisterViewWithRegion() is an extension method.
>
> On Sep 9, 4:57 pm, Alex McMahon  wrote:
> > A few observations:
> > 1. The usage pattern for Unity seems a bit odd. I wouldn't expect to
> > see any references to unity in the majority of an application's
> > classes. One of the main points about IoC such as Unity is that it
> > automatically resolves dependencies so if you changed your
> > StatusBarModule constructor to take and IRegionManager and an
> > IEventAggregator then when unity tries to build your StatusBarModule
> > it will automatically populate those construction parameters.
> > 2. Similarly with the call to Resolve this
> > could/should be replaced with a dependency that is populated by unity
> > (probably in the constructor).
> > 3. Once you replace the constructor parameters your test can get rid
> > of the MockUnityContainer and just create MockRegionManager (and other
> > dependencies), pass it in explicitly in the constructor (Note that
> > during the test Unity will not be used at all) Then in the actual test
> > you can just write
> > regionManager.AssertWasCalled(x=>x.RegisterViewWithRegion()
> >
> > I must admit my knowledge of Prism and Unity is patchy, but with CAB
> > (the precursor to Prism) this was how we worked.
> >
> > Try only having one place in your application aware of Unity, and let
> > all the dependencies of your object graph be populated by unity. This
> > will leave your application much less tightly bound to Unity.
> >
> > 2009/9/9 bill richards :
> >
> >
> >
> >
> >
> > > Alex,
> >
> > > thanks for that, and the point is conceeded:
> >
> > > The code as posted represents the "Arrange" aspect of the AAA test,
> > > and the remainder was not posted, because at the time of posting, it
> > > seemed superfluous to the issue I am trying to resolve.
> >
> > > I also agree that there are quite a number of items being stubbed, but
> > > this is due to the complexity of the framework (Prism V2).
> >
> > > This is class definition for the object under test:
> >
> > >public class StatusBarModule
> > >{
> > >public StatusBarModule(IUnityContainer container)
> > >{
> > >Container = container;
> > >RegionManager = Container.Resolve();
> > >TheEventAggregator = Container.Resolve
> > > ();
> > >}
> >
> > >public IUnityContainer Container { get; private set; }
> > >public IRegionManager RegionManager { get; private set; }
> > >protected IEventAggregator TheEventAggregator { get; private
> > > set; }
> >
> > >public void
> > > RegisterViewsAndServicesNotLoadedThroughConfiguration() { }
> >
> > >public void RaiseAnyPertinentEventsEtc() { }
> >
> > >public string ConfigurationContainerName { get { return
> > > "Status"; } }
> >
> > >public void Initialize()
> > >{
> > >var section = (UnityConfigurationSection)
> > > ConfigurationManager.GetSection("Unity");
> > >if (section != null && section.Containers
> > > [ConfigurationContainerName] != null)
> > >section.Containers
> > > [ConfigurationContainerName].Configure(Container);
> >
> > >RegisterViewsAndServicesNotLoadedThroughConfiguration();
> > >RegisterViewsWithRegions();
> > >RaiseAnyPertinentEventsEtc();
> > >}
> >
> > >public void RegisterViewsWithRegions()
> > >{
> > >RegionManager.RegisterViewWithRegion
> > > (RegionNames.StatusBarRegion, () =>
> > > Container.Resolve().View);
> > >}
> >
> > >}
> >
> > > And this is the full test:
> >
> > >[Test]
> > >public void
> > > WhenInstantiated_ShouldRegisterIStatusBarViewWithRegionManager()
> > >{
> > >var unity = MockRepository.GenerateStub
> > > ();
> > >var presenter =
> > > MockRepository.GenerateStub();
> > >var view = MockRepository.GenerateStub();
> > >presenter.View = view;
> >
> > >var eventAggregator =
> > > MockRepository.GenerateStub();
> > >var regionManager =
> > > MockRepository.GenerateStub();
> > >var region = MockRepository.GenerateStub();
> > >var regionCollection =
> > > MockRepository.GenerateMock();
> > >regionCollection.Add(RegionNames.StatusBarRegion, region);
> >
> > >regionManager.Stub(r => r.Regions).Return
> > > (regionCollection);
> >
> > >unity.Stub(container => container.Resolve
> > > ()).Return(eventAggregator);
> > >unity.Stub(container => container.Resolve
> > > ()).Return(regionManager);
> > >unity.Stub(container =>
> > > container.Resolve()).Return(presenter);
> >
> > >new StatusBarModule(unity).Initialize(); //
> > > 

[RhinoMocks] Re: System.InvalidCastException: Unable to cast object oftype 'ObjectProxy

2009-09-08 Thread Ayende Rahien
http://github.com/ayende/rhino-mocks/tree/master

On Tue, Sep 8, 2009 at 11:51 PM, Tim Barcz  wrote:

> I'll be the dunce in the roomwhat is the Git url for the project?
>
> tim
>
>
> On Tue, Sep 8, 2009 at 3:28 PM, Ayende Rahien  wrote:
>
>> I would prefer doing it on git.There are some changes that are only
>> there.
>>
>>
>> On Tue, Sep 8, 2009 at 11:24 PM, Tim Barcz  wrote:
>>
>>> On Git? or SourceForge? (SourceForge is easier for me right now, but will
>>> do Git if we've migrated)
>>>
>>> Tim
>>>
>>>
>>> On Tue, Sep 8, 2009 at 3:22 PM, Ayende Rahien  wrote:
>>>
>>>> No problem from my side.
>>>>
>>>> On Tue, Sep 8, 2009 at 11:18 PM, Tim Barcz  wrote:
>>>>
>>>>> This makes me wonder if we should pull down the latest DynamicProxy and
>>>>> make a new 3.6.1 drop.
>>>>>
>>>>> Thoughts?
>>>>>
>>>>> On Tue, Sep 8, 2009 at 2:41 PM, bill richards <
>>>>> bill.richa...@greyskin.co.uk> wrote:
>>>>>
>>>>>>
>>>>>> Thanks for your help here guys, it is much appreciated.
>>>>>>
>>>>>> I'm going to carry on with your version, but try my hardest not to
>>>>>> utilize your extra feature set, so that when the next official build
>>>>>> is released (hopefully including DynamicProxy2) we can get back to a
>>>>>> current and supported library.
>>>>>>
>>>>>> On Sep 8, 8:34 pm, Kenneth Xu  wrote:
>>>>>> > Great!
>>>>>> >
>>>>>> > Now it is your choice of keeping my version of RM (with many
>>>>>> enhanced
>>>>>> > feature that you (most likely) won't get it in future RM releases,
>>>>>> or
>>>>>> > get the RM source and compile one yourself with latest
>>>>>> DynamicProxy2.
>>>>>> >
>>>>>> > On Tue, Sep 8, 2009 at 3:18 PM, bill
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > richards wrote:
>>>>>> > > however when I made this
>>>>>> > > change, it worked as expected- Hide quoted text -
>>>>>> >
>>>>>> > - Show quoted text -
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Tim Barcz
>>>>> Microsoft ASPInsider
>>>>> http://timbarcz.devlicio.us
>>>>> http://www.twitter.com/timbarcz
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> Microsoft ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: System.InvalidCastException: Unable to cast object oftype 'ObjectProxy

2009-09-08 Thread Ayende Rahien
I would prefer doing it on git.There are some changes that are only there.

On Tue, Sep 8, 2009 at 11:24 PM, Tim Barcz  wrote:

> On Git? or SourceForge? (SourceForge is easier for me right now, but will
> do Git if we've migrated)
>
> Tim
>
>
> On Tue, Sep 8, 2009 at 3:22 PM, Ayende Rahien  wrote:
>
>> No problem from my side.
>>
>> On Tue, Sep 8, 2009 at 11:18 PM, Tim Barcz  wrote:
>>
>>> This makes me wonder if we should pull down the latest DynamicProxy and
>>> make a new 3.6.1 drop.
>>>
>>> Thoughts?
>>>
>>> On Tue, Sep 8, 2009 at 2:41 PM, bill richards <
>>> bill.richa...@greyskin.co.uk> wrote:
>>>
>>>>
>>>> Thanks for your help here guys, it is much appreciated.
>>>>
>>>> I'm going to carry on with your version, but try my hardest not to
>>>> utilize your extra feature set, so that when the next official build
>>>> is released (hopefully including DynamicProxy2) we can get back to a
>>>> current and supported library.
>>>>
>>>> On Sep 8, 8:34 pm, Kenneth Xu  wrote:
>>>> > Great!
>>>> >
>>>> > Now it is your choice of keeping my version of RM (with many enhanced
>>>> > feature that you (most likely) won't get it in future RM releases, or
>>>> > get the RM source and compile one yourself with latest DynamicProxy2.
>>>> >
>>>> > On Tue, Sep 8, 2009 at 3:18 PM, bill
>>>> >
>>>> >
>>>> >
>>>> > richards wrote:
>>>> > > however when I made this
>>>> > > change, it worked as expected- Hide quoted text -
>>>> >
>>>> > - Show quoted text -
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> Microsoft ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: System.InvalidCastException: Unable to cast object oftype 'ObjectProxy

2009-09-08 Thread Ayende Rahien
No problem from my side.

On Tue, Sep 8, 2009 at 11:18 PM, Tim Barcz  wrote:

> This makes me wonder if we should pull down the latest DynamicProxy and
> make a new 3.6.1 drop.
>
> Thoughts?
>
> On Tue, Sep 8, 2009 at 2:41 PM, bill richards <
> bill.richa...@greyskin.co.uk> wrote:
>
>>
>> Thanks for your help here guys, it is much appreciated.
>>
>> I'm going to carry on with your version, but try my hardest not to
>> utilize your extra feature set, so that when the next official build
>> is released (hopefully including DynamicProxy2) we can get back to a
>> current and supported library.
>>
>> On Sep 8, 8:34 pm, Kenneth Xu  wrote:
>> > Great!
>> >
>> > Now it is your choice of keeping my version of RM (with many enhanced
>> > feature that you (most likely) won't get it in future RM releases, or
>> > get the RM source and compile one yourself with latest DynamicProxy2.
>> >
>> > On Tue, Sep 8, 2009 at 3:18 PM, bill
>> >
>> >
>> >
>> > richards wrote:
>> > > however when I made this
>> > > change, it worked as expected- Hide quoted text -
>> >
>> > - Show quoted text -
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: GIT for RhinoMocks repository?

2009-09-08 Thread Ayende Rahien
I think we will take this to rhino-tools, but ideally I would like to see us
managing things using pull requests.

On Tue, Sep 8, 2009 at 9:48 PM, Tim Barcz  wrote:

> I committed some code (one cmall change with four test cases) on Saturday
> to sourceforge...did that by any chance make it in, or do I need to switch
> over to GIT and submit push there?
>
>
>
> On Tue, Sep 8, 2009 at 1:46 PM, Ayende Rahien  wrote:
>
>> Yes
>>
>>
>> On Tue, Sep 8, 2009 at 9:41 PM, Tim Barcz  wrote:
>>
>>> Should we be looking and pulling source from Git now?
>>>
>>>
>>> On Tue, Sep 8, 2009 at 1:25 PM, Ayende Rahien  wrote:
>>>
>>>> I want to move the entire suite to Git, yes.Currently the SVN version
>>>> has a patch that the GIT version has as well, but the 3.6 was released from
>>>> the GIT version.
>>>>
>>>> On Tue, Sep 8, 2009 at 9:11 PM, Tim Barcz  wrote:
>>>>
>>>>>  I know Oren said he was up for it.
>>>>>
>>>>> I'm getting into Git on my own and would like see us take a spin down
>>>>> that road.
>>>>>
>>>>> On Tue, Sep 8, 2009 at 1:00 PM, Adam Dymitruk wrote:
>>>>>
>>>>>>
>>>>>> I think Tim Barcz was asking about this in the 4.0 thread. Was the
>>>>>> silence an indication of 'no'?
>>>>>>
>>>>>> --
>>>>>> Adam
>>>>>>
>>>>>> http://twitter.com/adymitruk/
>>>>>> http://www.agilevancouver.net/
>>>>>> http://altnetvancouver.ning.com/
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Tim Barcz
>>>>> Microsoft ASPInsider
>>>>> http://timbarcz.devlicio.us
>>>>> http://www.twitter.com/timbarcz
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> Microsoft ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: GIT for RhinoMocks repository?

2009-09-08 Thread Ayende Rahien
Yes

On Tue, Sep 8, 2009 at 9:41 PM, Tim Barcz  wrote:

> Should we be looking and pulling source from Git now?
>
>
> On Tue, Sep 8, 2009 at 1:25 PM, Ayende Rahien  wrote:
>
>> I want to move the entire suite to Git, yes.Currently the SVN version has
>> a patch that the GIT version has as well, but the 3.6 was released from the
>> GIT version.
>>
>> On Tue, Sep 8, 2009 at 9:11 PM, Tim Barcz  wrote:
>>
>>>  I know Oren said he was up for it.
>>>
>>> I'm getting into Git on my own and would like see us take a spin down
>>> that road.
>>>
>>> On Tue, Sep 8, 2009 at 1:00 PM, Adam Dymitruk wrote:
>>>
>>>>
>>>> I think Tim Barcz was asking about this in the 4.0 thread. Was the
>>>> silence an indication of 'no'?
>>>>
>>>> --
>>>> Adam
>>>>
>>>> http://twitter.com/adymitruk/
>>>> http://www.agilevancouver.net/
>>>> http://altnetvancouver.ning.com/
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> Microsoft ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: GIT for RhinoMocks repository?

2009-09-08 Thread Ayende Rahien
I want to move the entire suite to Git, yes.Currently the SVN version has a
patch that the GIT version has as well, but the 3.6 was released from the
GIT version.

On Tue, Sep 8, 2009 at 9:11 PM, Tim Barcz  wrote:

> I know Oren said he was up for it.
>
> I'm getting into Git on my own and would like see us take a spin down that
> road.
>
> On Tue, Sep 8, 2009 at 1:00 PM, Adam Dymitruk  wrote:
>
>>
>> I think Tim Barcz was asking about this in the 4.0 thread. Was the
>> silence an indication of 'no'?
>>
>> --
>> Adam
>>
>> http://twitter.com/adymitruk/
>> http://www.agilevancouver.net/
>> http://altnetvancouver.ning.com/
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-05 Thread Ayende Rahien
Kenneth,You will be able to reference both 3.6 & 4.0 on the same project.
And I don't believe that changing the namespace is going to be a major task.
Search/replace "using Rhino.Mocks" -> "using Rhino.Mocks.BackwardCompact" is
a 1 min task

On Sat, Sep 5, 2009 at 1:30 AM, Kenneth Xu  wrote:

>
> Hi Ayende,
>
> > Yes, I think that we aren't going to have any choice and we would support
> > side-by-side execution.
> Great :)
>
> > I don't want to change the name, though.
> Understood. Actually I too would hate to do so.
>
> I have heard that another Mock framework would like to support
> existing RhinoMocks syntax by providing exact same public
> class/interface/method names under a different namespace. I was
> wondering why this is necessary. *If* I'm going to embark Xyz mock
> framework, all I need to do is leaving the RhinoMocks as is and add
> reference to Xyz. I need to do nothing to start taking advantage of
> Xyz. Their proposal will actually make my life harder because I will
> be forced to change the namespace in every test classes.
>
> I'm a bit concerned about how the side-by-side execution will be
> implemented. If it is done by moving all the old syntax to another
> namespace and Rhino.Mocks are now used by 4.0 new syntax. Then it
> becomes a problem for an evolving project with half (and large amount)
> of tests completed with old syntax.
>
> 1. I cannot reference to both 3.6.dll and 4.0.dll, they conflict in
> namespace.
> 2. If use 4.0.dll + compatible.dll, I need to touch almost every each
> test fixture.
>
> In this case, moving to Xyz would be an easier option then upgrading to
> 4.0.
>
> So from a user perspective, I would love to see 4.0 in a new namespace
> rather then Rhino.Mocks. Be it RhinoMocks without dot, Rhino.Mocks4 or
> whatever, I bet there are smart souls here can come up with a cool
> name that keeps the branding of Rhino Mocks but a different namespace
> then 3.x. I believe this also simplifies the development of 4.0 as
> there is no need for compatibility.dll. Thoughts?
>
> Just my 2 cents :)
>
> Cheers,
> Kenneth
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-05 Thread Ayende Rahien
Kenneth,Side by side is going to be a goal.

On Fri, Sep 4, 2009 at 10:47 PM, Kenneth Xu  wrote:

>
> Hi Jason,
>
> > if a suite of tests is using the old syntax and there are no plans to
> > update the tests using the new syntax why upgrade to the latest
> > version of Rhino.Mocks?
>
> How about an actively evolving project that already have hundreds of
> test fixtures (which translate to thousands of test cases) using old
> syntax and would like to use new syntax on other few hundreds of test
> fixtures yet to be written?
>
> > At some point there would be pain to migrate
> > from old syntax to new syntax, how that process is managed will
> > determine how much effort is required.
>
> The point is that, ideally, I shouldn't be forced to migrate. I'll
> just leave the old test cases as is and create new test cases with new
> syntax within the same project.
>
> Cheers,
> Kenneth
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
works for me as the basis for what we do, yes :-)

On Fri, Sep 4, 2009 at 6:02 PM, Tim Barcz  wrote:

> I suggested this before (possibly in a different thread)
>
> but I would like to see the type inferred from usage.
>
> // Arrange
> var fake = Fake.Create();
> fake.Stub(x=>x.Method()).Return("hello world");
>
> // Act
> fake.Method()
>
>
>
> // Arrange
> var fake = Fake.Create();
> fake.Stub(x=>x.Method()).Return("hello world");
>
> // Act
> fake.Method()
>
> // Assert
> fake.AssertWasCalled(x=>x.Bar())
>
>
>
> On Fri, Sep 4, 2009 at 9:29 AM, Ayende Rahien  wrote:
>
>> Ideally, I would like to get some ideas about the desired syntax and
>> capabilities.That will allow us to have better idea about what is needed.
>> I intend to make use of a lot of the RM existing infrastructure, so it is
>> the surface behavior that interests me the most.
>>
>> On Fri, Sep 4, 2009 at 5:23 PM, Tim Barcz  wrote:
>>
>>> I too am curious on the organizing around this...
>>>
>>> Do we need/want to set up something like tickets or use AgileZen (or
>>> other tools) for project purposes?
>>>
>>> Tim
>>>
>>>
>>> On Fri, Sep 4, 2009 at 3:17 AM, Alex McMahon wrote:
>>>
>>>>
>>>> Ayende,
>>>>
>>>> When you say "you are welcome to contribute" will you be organising
>>>> this in some way? will there be a list of tasks?
>>>>
>>>> I've not submitted a patch to Rhino Mocks before, but I'd be
>>>> interested in having a go at submitting one for 4.0.
>>>>
>>>> Do you think there will be tasks that could be tackled by someone
>>>> who's not already overly familiar with the code base?
>>>>
>>>> Regards
>>>> Alex McMahon
>>>>
>>>> 2009/9/1 Ayende Rahien :
>>>> > This is a blog post that would show up day after tomorrow, I am
>>>> posting it
>>>> > here to get some traction in the mailing list before we make it really
>>>> > public.
>>>> >
>>>> > Well, now that Rhino Mocks 3.6 is out of the way, we need to think
>>>> about
>>>> > what the next version will look like.
>>>> >
>>>> > Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
>>>> and
>>>> > support mocking dynamic variables, but while this is still on the
>>>> planning
>>>> > board, I think that it is much more important to stop and take a look
>>>> at
>>>> > where Rhino Mocks is now and where we would like it to be.
>>>> >
>>>> > I started Rhino Mocks about 5 years ago, and the codebase has stood
>>>> well in
>>>> > the test of time. There aren’t any nasty places and we can keep
>>>> releasing
>>>> > new features with no major issues.
>>>> >
>>>> > However, 5 years ago the community perception of mocking was different
>>>> than
>>>> > what it is now. Rhino Mocks hasn’t really changed significantly since
>>>> it 1.1
>>>> > days, for that matter, you can take a code base using Rhino Mocks for
>>>> .Net
>>>> > 1.1 and move it to Rhino Mocks 3.6 with no issues.
>>>> >
>>>> > But one of the most frequent complaints that I have heard is that
>>>> Rhino
>>>> > Mocks API has became too complex over the years, there are too many
>>>> options
>>>> > and knobs that you can turn. I know that my own style of interaction
>>>> testing
>>>> > has changed as well.
>>>> >
>>>> > The current plan for Rhino Mocks 4.0 is that we will break backward
>>>> > compatibility in a big way. That means that we are going to
>>>> drastically
>>>> > simplify everything in the framework.
>>>> >
>>>> > We are still discussing this in the mailing list, but currently it
>>>> looks
>>>> > like we will go with the following route:
>>>> >
>>>> > Kill the dynamic, strict, partial and stub terminology. No one cares.
>>>> It is
>>>> > a fake.
>>>> > Remove the record / playback API. The AAA method is much simpler.
>>>> > Simplify mocking options, aiming at moving as much as possible from
>>>> > expectation style to assert style.
>>>> > Keep as much of the current capabilities as we can. That means that if
>>>> Rhino
>>>> > Mocks was able to support a scenario, it should still support it for
>>>> the 4.0
>>>> > version, hopefully in a simpler fashion.
>>>> >
>>>> > The end result is putting Rhino Mocks on an API diet. I am looking for
>>>> help
>>>> > in doing this, both in terms of suggested syntax and in terms of
>>>> actual
>>>> > patches.
>>>> >
>>>> > You are welcome to contribute…
>>>> >
>>>> > >
>>>> >
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> Microsoft ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
Ideally, I would like to get some ideas about the desired syntax and
capabilities.That will allow us to have better idea about what is needed.
I intend to make use of a lot of the RM existing infrastructure, so it is
the surface behavior that interests me the most.

On Fri, Sep 4, 2009 at 5:23 PM, Tim Barcz  wrote:

> I too am curious on the organizing around this...
>
> Do we need/want to set up something like tickets or use AgileZen (or other
> tools) for project purposes?
>
> Tim
>
>
> On Fri, Sep 4, 2009 at 3:17 AM, Alex McMahon  wrote:
>
>>
>> Ayende,
>>
>> When you say "you are welcome to contribute" will you be organising
>> this in some way? will there be a list of tasks?
>>
>> I've not submitted a patch to Rhino Mocks before, but I'd be
>> interested in having a go at submitting one for 4.0.
>>
>> Do you think there will be tasks that could be tackled by someone
>> who's not already overly familiar with the code base?
>>
>> Regards
>> Alex McMahon
>>
>> 2009/9/1 Ayende Rahien :
>> > This is a blog post that would show up day after tomorrow, I am posting
>> it
>> > here to get some traction in the mailing list before we make it really
>> > public.
>> >
>> > Well, now that Rhino Mocks 3.6 is out of the way, we need to think about
>> > what the next version will look like.
>> >
>> > Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
>> and
>> > support mocking dynamic variables, but while this is still on the
>> planning
>> > board, I think that it is much more important to stop and take a look at
>> > where Rhino Mocks is now and where we would like it to be.
>> >
>> > I started Rhino Mocks about 5 years ago, and the codebase has stood well
>> in
>> > the test of time. There aren’t any nasty places and we can keep
>> releasing
>> > new features with no major issues.
>> >
>> > However, 5 years ago the community perception of mocking was different
>> than
>> > what it is now. Rhino Mocks hasn’t really changed significantly since it
>> 1.1
>> > days, for that matter, you can take a code base using Rhino Mocks for
>> .Net
>> > 1.1 and move it to Rhino Mocks 3.6 with no issues.
>> >
>> > But one of the most frequent complaints that I have heard is that Rhino
>> > Mocks API has became too complex over the years, there are too many
>> options
>> > and knobs that you can turn. I know that my own style of interaction
>> testing
>> > has changed as well.
>> >
>> > The current plan for Rhino Mocks 4.0 is that we will break backward
>> > compatibility in a big way. That means that we are going to drastically
>> > simplify everything in the framework.
>> >
>> > We are still discussing this in the mailing list, but currently it looks
>> > like we will go with the following route:
>> >
>> > Kill the dynamic, strict, partial and stub terminology. No one cares. It
>> is
>> > a fake.
>> > Remove the record / playback API. The AAA method is much simpler.
>> > Simplify mocking options, aiming at moving as much as possible from
>> > expectation style to assert style.
>> > Keep as much of the current capabilities as we can. That means that if
>> Rhino
>> > Mocks was able to support a scenario, it should still support it for the
>> 4.0
>> > version, hopefully in a simpler fashion.
>> >
>> > The end result is putting Rhino Mocks on an API diet. I am looking for
>> help
>> > in doing this, both in terms of suggested syntax and in terms of actual
>> > patches.
>> >
>> > You are welcome to contribute…
>> >
>> > >
>> >
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
You are right, I created a feedback forum is:
http://nhprof.uservoice.com/pages/28152-rhino-mocks-4-0

On Fri, Sep 4, 2009 at 1:42 PM, Stefan Steinegger <
stefan.steineg...@bluewin.ch> wrote:

>
> Are there already some concepts around? Do you start brainstorming,
> gathering ideas, or is this already done? I also have some wishes and
> things to say. I think that we use quite a large part of the Rhino
> features in our project.
>
> So if we start gathering ideas, we should have some platform, like a
> wiki or something, where everyone can post ideas and comment to others
> for a certain time period. There will be ideas for features, syntax
> and even basic concepts.
>
> On 4 Sep., 10:47, Ayende Rahien  wrote:
> > Alex,First thing to do is to decide where we are going, that is why this
> > discussion is so important.
> > Next stage is to get everyone's input and then start working. And yes, I
> do
> > mean submitting code.
> > I believe that if you'll take a look at the Rhino Mocks codebase, you'll
> be
> > able to get yourself familiarized in a short while.
> > It is a good codebase, even if I say so myself.
> >
> > On Fri, Sep 4, 2009 at 11:17 AM, Alex McMahon 
> wrote:
> >
> > > Ayende,
> >
> > > When you say "you are welcome to contribute" will you be organising
> > > this in some way? will there be a list of tasks?
> >
> > > I've not submitted a patch to Rhino Mocks before, but I'd be
> > > interested in having a go at submitting one for 4.0.
> >
> > > Do you think there will be tasks that could be tackled by someone
> > > who's not already overly familiar with the code base?
> >
> > > Regards
> > > Alex McMahon
> >
> > > 2009/9/1 Ayende Rahien :
> > > > This is a blog post that would show up day after tomorrow, I am
> posting
> > > it
> > > > here to get some traction in the mailing list before we make it
> really
> > > > public.
> >
> > > > Well, now that Rhino Mocks 3.6 is out of the way, we need to think
> about
> > > > what the next version will look like.
> >
> > > > Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
> and
> > > > support mocking dynamic variables, but while this is still on the
> > > planning
> > > > board, I think that it is much more important to stop and take a look
> at
> > > > where Rhino Mocks is now and where we would like it to be.
> >
> > > > I started Rhino Mocks about 5 years ago, and the codebase has stood
> well
> > > in
> > > > the test of time. There aren’t any nasty places and we can keep
> releasing
> > > > new features with no major issues.
> >
> > > > However, 5 years ago the community perception of mocking was
> different
> > > than
> > > > what it is now. Rhino Mocks hasn’t really changed significantly since
> it
> > > 1.1
> > > > days, for that matter, you can take a code base using Rhino Mocks for
> > > .Net
> > > > 1.1 and move it to Rhino Mocks 3.6 with no issues.
> >
> > > > But one of the most frequent complaints that I have heard is that
> Rhino
> > > > Mocks API has became too complex over the years, there are too many
> > > options
> > > > and knobs that you can turn. I know that my own style of interaction
> > > testing
> > > > has changed as well.
> >
> > > > The current plan for Rhino Mocks 4.0 is that we will break backward
> > > > compatibility in a big way. That means that we are going to
> drastically
> > > > simplify everything in the framework.
> >
> > > > We are still discussing this in the mailing list, but currently it
> looks
> > > > like we will go with the following route:
> >
> > > > Kill the dynamic, strict, partial and stub terminology. No one cares.
> It
> > > is
> > > > a fake.
> > > > Remove the record / playback API. The AAA method is much simpler.
> > > > Simplify mocking options, aiming at moving as much as possible from
> > > > expectation style to assert style.
> > > > Keep as much of the current capabilities as we can. That means that
> if
> > > Rhino
> > > > Mocks was able to support a scenario, it should still support it for
> the
> > > 4.0
> > > > version, hopefully in a simpler fashion.
> >
> > > > The end result is putting Rhino Mocks on an API diet. I am looking
> for
> > > help
> > > > in doing this, both in terms of suggested syntax and in terms of
> actual
> > > > patches.
> >
> > > > You are welcome to contribute…
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
Alex,First thing to do is to decide where we are going, that is why this
discussion is so important.
Next stage is to get everyone's input and then start working. And yes, I do
mean submitting code.
I believe that if you'll take a look at the Rhino Mocks codebase, you'll be
able to get yourself familiarized in a short while.
It is a good codebase, even if I say so myself.

On Fri, Sep 4, 2009 at 11:17 AM, Alex McMahon  wrote:

>
> Ayende,
>
> When you say "you are welcome to contribute" will you be organising
> this in some way? will there be a list of tasks?
>
> I've not submitted a patch to Rhino Mocks before, but I'd be
> interested in having a go at submitting one for 4.0.
>
> Do you think there will be tasks that could be tackled by someone
> who's not already overly familiar with the code base?
>
> Regards
> Alex McMahon
>
> 2009/9/1 Ayende Rahien :
> > This is a blog post that would show up day after tomorrow, I am posting
> it
> > here to get some traction in the mailing list before we make it really
> > public.
> >
> > Well, now that Rhino Mocks 3.6 is out of the way, we need to think about
> > what the next version will look like.
> >
> > Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release and
> > support mocking dynamic variables, but while this is still on the
> planning
> > board, I think that it is much more important to stop and take a look at
> > where Rhino Mocks is now and where we would like it to be.
> >
> > I started Rhino Mocks about 5 years ago, and the codebase has stood well
> in
> > the test of time. There aren’t any nasty places and we can keep releasing
> > new features with no major issues.
> >
> > However, 5 years ago the community perception of mocking was different
> than
> > what it is now. Rhino Mocks hasn’t really changed significantly since it
> 1.1
> > days, for that matter, you can take a code base using Rhino Mocks for
> .Net
> > 1.1 and move it to Rhino Mocks 3.6 with no issues.
> >
> > But one of the most frequent complaints that I have heard is that Rhino
> > Mocks API has became too complex over the years, there are too many
> options
> > and knobs that you can turn. I know that my own style of interaction
> testing
> > has changed as well.
> >
> > The current plan for Rhino Mocks 4.0 is that we will break backward
> > compatibility in a big way. That means that we are going to drastically
> > simplify everything in the framework.
> >
> > We are still discussing this in the mailing list, but currently it looks
> > like we will go with the following route:
> >
> > Kill the dynamic, strict, partial and stub terminology. No one cares. It
> is
> > a fake.
> > Remove the record / playback API. The AAA method is much simpler.
> > Simplify mocking options, aiming at moving as much as possible from
> > expectation style to assert style.
> > Keep as much of the current capabilities as we can. That means that if
> Rhino
> > Mocks was able to support a scenario, it should still support it for the
> 4.0
> > version, hopefully in a simpler fashion.
> >
> > The end result is putting Rhino Mocks on an API diet. I am looking for
> help
> > in doing this, both in terms of suggested syntax and in terms of actual
> > patches.
> >
> > You are welcome to contribute…
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
Kenneth,Yes, I think that we aren't going to have any choice and we would
support side-by-side execution.
I don't want to change the name, though.

On Fri, Sep 4, 2009 at 10:09 AM, Kenneth Xu  wrote:

>
> A. Agree that killing the backward compatibility is a must. All new
> development should go with new syntax.
>
> B. On the other hand, how about the evolving project with tons of
> existing tests using the old syntax? Must it stuck with old syntax
> forever or totally rewrite all tests?  I hope there is a better option
> would allow me to keep the old tests as is and use new syntax in new
> test cases being added to project. Maybe I can use 3.6 and 4.0 side by
> side just like I can have NMock (real old test cases) and Rhino.Mocks
> side by side in one project.
>
> How about a completely new namespace for 4.0? Rhino.Fakes is what I
> somebody who lack of imagination, can think about.
>
> Cheers,
> Kenneth
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
Michael,The code isn't going to magically not work once we have a new
version.
For people with existing code bases, the simple option is to simply not
migrate.
Moreover, moving to a new platform version is something that I *will* support
for 3.6.
In other words, if .NET 4.0 means that you can't use Rhino Mocks 3.6, I'll
fix it.

On Fri, Sep 4, 2009 at 8:47 AM, Michael Ketting
wrote:

>
> I believe there are two sides to what backwards compatibility is.
>
> One is changing the names of a few namespaces, classes, or members.
> Basically, stuff that can be fixed by R# quickfixes, search&replaces,
> etc.
>
> The other is, killing the support for creating a MockRepository and
> setting up mocks in the "old" way with Record/Verify. And I'm not just
> talking about being able to easily setting up whitelist-expectations.
> While this can be a no-go criteria in and of itself depending on the
> testing philosophy, there is an even bigger issue. Test suites that
> rely heavily on mocking usually are quite old. And for big projects,
> quite extensive. I'm talking about several thousand tests here. And
> that's several thousand tests that would have to be migrated, one by
> one, if one where to migrate to Rhino.Mocks 4.0.
>
> So, the actual question would be, will you provide a dotNet 4.0 and
> potentially a dotNet 5.0 release of Rhino.Mocks 3.6 for projects where
> the migration process would take several years? And yes, I know, we
> can always build our own Rhino.Mocks.
>
> Bottom line is, breaking backwards compatibility on a feature level
> will be a major blow for projects that have been a loyal follower of
> Rhino.Mocks since the early days of the project.
>
> Michael
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-04 Thread Ayende Rahien
Nathan,My response to the profiler API argument is the same as it has always
been.
I don't care for that, so I am not going to spend time working on this.
If I get a patch, then we can talk about it.

On Fri, Sep 4, 2009 at 6:05 AM, Nathan  wrote:

>
> Hello,
>
> I've enjoyed using Rhino.Mocks, but I had a couple things I would like
> to add to this discussion.
>
> I like the idea of having version 4.0 as a separate namespace if it's
> going to break compatibility.
>
> I really think that Rhino.Mocks should add the capability using the
> profiler API and thus the ability to mock out static functions and
> other non-virtual functions.  I realize that brings about a
> philosophical debate to many people about the right way to code.
> However, when I'm using a component or library that is out of my
> control and I need the ability to mock it, then not being able to gets
> in the way of me getting my work done and having unit testable code.
>
> On Sep 1, 10:56 am, Ayende Rahien  wrote:
> > This is a blog post that would show up day after tomorrow, I am posting
> it
> > here to get some traction in the mailing list before we make it really
> > public.
> >
> > Well, now that Rhino Mocks 3.6 is out of the way, we need to think about
> > what the next version will look like.
> >
> > Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release and
> > support mocking dynamic variables, but while this is still on the
> planning
> > board, I think that it is much more important to stop and take a look at
> > where Rhino Mocks is now and where we would like it to be.
> >
> > I started Rhino Mocks about 5 years ago, and the codebase has stood well
> in
> > the test of time. There aren’t any nasty places and we can keep releasing
> > new features with no major issues.
> >
> > However, 5 years ago the community perception of mocking was different
> than
> > what it is now. Rhino Mocks hasn’t really changed significantly since it
> 1.1
> > days, for that matter, you can take a code base using Rhino Mocks for
> .Net
> > 1.1 and move it to Rhino Mocks 3.6 with no issues.
> >
> > But one of the most frequent complaints that I have heard is that Rhino
> > Mocks API has became too complex over the years, there are too many
> options
> > and knobs that you can turn. I know that my own style of interaction
> testing
> > has changed as well.
> >
> > The current plan for Rhino Mocks 4.0 is that we will break backward
> > compatibility in a big way. That means that we are going to drastically
> > simplify everything in the framework.
> >
> > We are still discussing this in the mailing list, but currently it looks
> > like we will go with the following route:
> >
> >- Kill the dynamic, strict, partial and stub terminology. No one
> cares.
> >It is a fake.
> >- Remove the record / playback API. The AAA method is much simpler.
> >- Simplify mocking options, aiming at moving as much as possible from
> >expectation style to assert style.
> >- Keep as much of the current capabilities as we can. That means that
> if
> >Rhino Mocks was able to support a scenario, it should still support it
> for
> >the 4.0 version, hopefully in a simpler fashion.
> >
> > The end result is putting Rhino Mocks on an API diet. I am looking for
> help
> > in doing this, both in terms of suggested syntax and in terms of actual
> > patches.
> >
> > You are welcome to contribute…
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-03 Thread Ayende Rahien
I think killing backwards compatibility is a must have.

Is that what you mean?

On Thu, Sep 3, 2009 at 10:36 PM, Shane C  wrote:

>
> I think backwards compatibility is a must have.  Presenting on and
> teaching Rhino Mocks to a new team has gotten silly because of how big
> the API has gotten.  I would gladly stick with Rhino Mocks 3.6 where
> currently used and Rhino Mocks 4.0 for new stuff...
>
> On Sep 1, 10:19 am, Tim Barcz  wrote:
> > Do we need to kill backwards compatibility.  I'm working on a patch/spike
> > where the class Fake is used which really just calls MockRepository under
> > the hood?
> >
> > Thoughts?
> >
> >
> >
> > On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien 
> wrote:
> > > This is a blog post that would show up day after tomorrow, I am posting
> it
> > > here to get some traction in the mailing list before we make it really
> > > public.
> >
> > > Well, now that Rhino Mocks 3.6 is out of the way, we need to think
> about
> > > what the next version will look like.
> >
> > > Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
> and
> > > support mocking dynamic variables, but while this is still on the
> planning
> > > board, I think that it is much more important to stop and take a look
> at
> > > where Rhino Mocks is now and where we would like it to be.
> >
> > > I started Rhino Mocks about 5 years ago, and the codebase has stood
> well in
> > > the test of time. There aren’t any nasty places and we can keep
> releasing
> > > new features with no major issues.
> >
> > > However, 5 years ago the community perception of mocking was different
> than
> > > what it is now. Rhino Mocks hasn’t really changed significantly since
> it 1.1
> > > days, for that matter, you can take a code base using Rhino Mocks for
> .Net
> > > 1.1 and move it to Rhino Mocks 3.6 with no issues.
> >
> > > But one of the most frequent complaints that I have heard is that Rhino
> > > Mocks API has became too complex over the years, there are too many
> options
> > > and knobs that you can turn. I know that my own style of interaction
> testing
> > > has changed as well.
> >
> > > The current plan for Rhino Mocks 4.0 is that we will break backward
> > > compatibility in a big way. That means that we are going to drastically
> > > simplify everything in the framework.
> >
> > > We are still discussing this in the mailing list, but currently it
> looks
> > > like we will go with the following route:
> >
> > >- Kill the dynamic, strict, partial and stub terminology. No one
> cares.
> > >It is a fake.
> > >- Remove the record / playback API. The AAA method is much simpler.
> > >- Simplify mocking options, aiming at moving as much as possible
> from
> > >expectation style to assert style.
> > >- Keep as much of the current capabilities as we can. That means
> that
> > >if Rhino Mocks was able to support a scenario, it should still
> support it
> > >for the 4.0 version, hopefully in a simpler fashion.
> >
> > > The end result is putting Rhino Mocks on an API diet. I am looking for
> help
> > > in doing this, both in terms of suggested syntax and in terms of actual
> > > patches.
> >
> > > You are welcome to contribute…
> >
> > --
> > Tim Barcz
> > Microsoft ASPInsiderhttp://timbarcz.devlicio.ushttp://
> www.twitter.com/timbarcz
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
I wasn't, do listen to that, it is somewhere in the first 15 minutes.
On Tue, Sep 1, 2009 at 10:35 PM, Tim Barcz  wrote:

> I was being facetious ...
>
> On Tue, Sep 1, 2009 at 2:29 PM, Ayende Rahien  wrote:
>
>> Hm, listen to my DNR from Oredev about Rhino Mocks.Specifically, to Carl
>> asking what Rhino Mocks is.
>>
>>
>> On Tue, Sep 1, 2009 at 10:09 PM, Tim Barcz  wrote:
>>
>>> ah...yes I see...we need a Wizard (very good, let's do it!).
>>>
>>>
>>> On Tue, Sep 1, 2009 at 1:56 PM, Jason Meckley wrote:
>>>
>>>>
>>>> Alex, a simpler API would lower the entry level. But lets also not
>>>> forget (as much as we want to) the entry level for .net development is
>>>> "where is the IDE Wizard?"
>>>> that said moving the old syntax to another namespace still makes the
>>>> option available and can confuse the developer. If you're trying to
>>>> reduce the surface area, and reduce friction; move the old
>>>> functionality to another assembly (Rhino.Mocks.OldSchool.dll). This
>>>> way the user needs 2 assemblies for backwards compatibility. moving
>>>> forward (4.1?) Rhino.Mocks.OldSchool.dll is dropped altogether.
>>>>
>>>> On Sep 1, 12:55 pm, Alex McMahon  wrote:
>>>> > I think a good goal is to reduce the barrier to entry of Rhino Mocks.
>>>> > I see a lot of questions being asked on the mailing list that are a
>>>> > result of new users trying to get to grips with the tooling and
>>>> > wandering down paths that lead to the same common errors, e.g. mixing
>>>> > different syntaxes together.
>>>> >
>>>> > If we can achieve this without losing any functionality or syntaxes
>>>> > then that seems ok, but the default and easiest exploration path
>>>> > should be limited to the chosen syntax (AAA).
>>>> >
>>>> > Perhaps this means moving all the classes relating to older syntaxes
>>>> > into a different namespace (Rhino.Mocks.Interop? probably a better
>>>> > name would be needed) so people can upgrade to 4.0 and keep everything
>>>> > the same by just adding a using to this namespace. Then in the main
>>>> > namespace (Rhino.Mocks) we keep as small a surface area so that a new
>>>> > user could pretty much get started just by using intellisense.
>>>> >
>>>> > When a user starts using the Interop namespace and getting it all
>>>> > mixed up leading to asking the questions (as I'm sure some will) we
>>>> > can say "The Interop namespace is designed only for backwards
>>>> > compatibility scenarios, please use the Rhino.Mocks.Fake class and
>>>> seehttp://ayende.com/wiki/Rhino+Mocks.ashxfor usage details"
>>>> >
>>>> > 2009/9/1 Tim Barcz :
>>>> >
>>>> > > Do we need to kill backwards compatibility.  I'm working on a
>>>> patch/spike
>>>> > > where the class Fake is used which really just calls MockRepository
>>>> under
>>>> > > the hood?
>>>> >
>>>> > > Thoughts?
>>>> >
>>>> > > On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien 
>>>> wrote:
>>>> >
>>>> > >> This is a blog post that would show up day after tomorrow, I am
>>>> posting it
>>>> > >> here to get some traction in the mailing list before we make it
>>>> really
>>>> > >> public.
>>>> >
>>>> > >> Well, now that Rhino Mocks 3.6 is out of the way, we need to think
>>>> about
>>>> > >> what the next version will look like.
>>>> >
>>>> > >> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0
>>>> release and
>>>> > >> support mocking dynamic variables, but while this is still on the
>>>> planning
>>>> > >> board, I think that it is much more important to stop and take a
>>>> look at
>>>> > >> where Rhino Mocks is now and where we would like it to be.
>>>> >
>>>> > >> I started Rhino Mocks about 5 years ago, and the codebase has stood
>>>> well
>>>> > >> in the test of time. There aren’t any nasty places and we can keep
>>>> releasing
>>>> > >> new featur

[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
But we might want to have this discussion in rhino-tools-dev

On Tue, Sep 1, 2009 at 10:36 PM, Ayende Rahien  wrote:

> I am currently using it to handle the splitting process.So far, I *really* 
> like
> it.
> Moreover, it seems like it would be a great liberator from the point of
> view of not having to accept patches, but having people fork & merge the
> changes.
>
>
> On Tue, Sep 1, 2009 at 10:32 PM, Tim Barcz  wrote:
>
>> Anyone think a GitHub move is worthwhile?
>>
>>
>> On Tue, Sep 1, 2009 at 2:09 PM, Tim Barcz  wrote:
>>
>>> ah...yes I see...we need a Wizard (very good, let's do it!).
>>>
>>>
>>> On Tue, Sep 1, 2009 at 1:56 PM, Jason Meckley wrote:
>>>
>>>>
>>>> Alex, a simpler API would lower the entry level. But lets also not
>>>> forget (as much as we want to) the entry level for .net development is
>>>> "where is the IDE Wizard?"
>>>> that said moving the old syntax to another namespace still makes the
>>>> option available and can confuse the developer. If you're trying to
>>>> reduce the surface area, and reduce friction; move the old
>>>> functionality to another assembly (Rhino.Mocks.OldSchool.dll). This
>>>> way the user needs 2 assemblies for backwards compatibility. moving
>>>> forward (4.1?) Rhino.Mocks.OldSchool.dll is dropped altogether.
>>>>
>>>> On Sep 1, 12:55 pm, Alex McMahon  wrote:
>>>> > I think a good goal is to reduce the barrier to entry of Rhino Mocks.
>>>> > I see a lot of questions being asked on the mailing list that are a
>>>> > result of new users trying to get to grips with the tooling and
>>>> > wandering down paths that lead to the same common errors, e.g. mixing
>>>> > different syntaxes together.
>>>> >
>>>> > If we can achieve this without losing any functionality or syntaxes
>>>> > then that seems ok, but the default and easiest exploration path
>>>> > should be limited to the chosen syntax (AAA).
>>>> >
>>>> > Perhaps this means moving all the classes relating to older syntaxes
>>>> > into a different namespace (Rhino.Mocks.Interop? probably a better
>>>> > name would be needed) so people can upgrade to 4.0 and keep everything
>>>> > the same by just adding a using to this namespace. Then in the main
>>>> > namespace (Rhino.Mocks) we keep as small a surface area so that a new
>>>> > user could pretty much get started just by using intellisense.
>>>> >
>>>> > When a user starts using the Interop namespace and getting it all
>>>> > mixed up leading to asking the questions (as I'm sure some will) we
>>>> > can say "The Interop namespace is designed only for backwards
>>>> > compatibility scenarios, please use the Rhino.Mocks.Fake class and
>>>> seehttp://ayende.com/wiki/Rhino+Mocks.ashxfor usage details"
>>>> >
>>>> > 2009/9/1 Tim Barcz :
>>>> >
>>>> > > Do we need to kill backwards compatibility.  I'm working on a
>>>> patch/spike
>>>> > > where the class Fake is used which really just calls MockRepository
>>>> under
>>>> > > the hood?
>>>> >
>>>> > > Thoughts?
>>>> >
>>>> > > On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien 
>>>> wrote:
>>>> >
>>>> > >> This is a blog post that would show up day after tomorrow, I am
>>>> posting it
>>>> > >> here to get some traction in the mailing list before we make it
>>>> really
>>>> > >> public.
>>>> >
>>>> > >> Well, now that Rhino Mocks 3.6 is out of the way, we need to think
>>>> about
>>>> > >> what the next version will look like.
>>>> >
>>>> > >> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0
>>>> release and
>>>> > >> support mocking dynamic variables, but while this is still on the
>>>> planning
>>>> > >> board, I think that it is much more important to stop and take a
>>>> look at
>>>> > >> where Rhino Mocks is now and where we would like it to be.
>>>> >
>>>> > >> I started Rhino Mocks about 5 years ago, and the codebase has stood
>>>> well
>

[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
I am currently using it to handle the splitting process.So far, I *really* like
it.
Moreover, it seems like it would be a great liberator from the point of view
of not having to accept patches, but having people fork & merge the changes.

On Tue, Sep 1, 2009 at 10:32 PM, Tim Barcz  wrote:

> Anyone think a GitHub move is worthwhile?
>
>
> On Tue, Sep 1, 2009 at 2:09 PM, Tim Barcz  wrote:
>
>> ah...yes I see...we need a Wizard (very good, let's do it!).
>>
>>
>> On Tue, Sep 1, 2009 at 1:56 PM, Jason Meckley wrote:
>>
>>>
>>> Alex, a simpler API would lower the entry level. But lets also not
>>> forget (as much as we want to) the entry level for .net development is
>>> "where is the IDE Wizard?"
>>> that said moving the old syntax to another namespace still makes the
>>> option available and can confuse the developer. If you're trying to
>>> reduce the surface area, and reduce friction; move the old
>>> functionality to another assembly (Rhino.Mocks.OldSchool.dll). This
>>> way the user needs 2 assemblies for backwards compatibility. moving
>>> forward (4.1?) Rhino.Mocks.OldSchool.dll is dropped altogether.
>>>
>>> On Sep 1, 12:55 pm, Alex McMahon  wrote:
>>> > I think a good goal is to reduce the barrier to entry of Rhino Mocks.
>>> > I see a lot of questions being asked on the mailing list that are a
>>> > result of new users trying to get to grips with the tooling and
>>> > wandering down paths that lead to the same common errors, e.g. mixing
>>> > different syntaxes together.
>>> >
>>> > If we can achieve this without losing any functionality or syntaxes
>>> > then that seems ok, but the default and easiest exploration path
>>> > should be limited to the chosen syntax (AAA).
>>> >
>>> > Perhaps this means moving all the classes relating to older syntaxes
>>> > into a different namespace (Rhino.Mocks.Interop? probably a better
>>> > name would be needed) so people can upgrade to 4.0 and keep everything
>>> > the same by just adding a using to this namespace. Then in the main
>>> > namespace (Rhino.Mocks) we keep as small a surface area so that a new
>>> > user could pretty much get started just by using intellisense.
>>> >
>>> > When a user starts using the Interop namespace and getting it all
>>> > mixed up leading to asking the questions (as I'm sure some will) we
>>> > can say "The Interop namespace is designed only for backwards
>>> > compatibility scenarios, please use the Rhino.Mocks.Fake class and
>>> seehttp://ayende.com/wiki/Rhino+Mocks.ashxfor usage details"
>>> >
>>> > 2009/9/1 Tim Barcz :
>>> >
>>> > > Do we need to kill backwards compatibility.  I'm working on a
>>> patch/spike
>>> > > where the class Fake is used which really just calls MockRepository
>>> under
>>> > > the hood?
>>> >
>>> > > Thoughts?
>>> >
>>> > > On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien 
>>> wrote:
>>> >
>>> > >> This is a blog post that would show up day after tomorrow, I am
>>> posting it
>>> > >> here to get some traction in the mailing list before we make it
>>> really
>>> > >> public.
>>> >
>>> > >> Well, now that Rhino Mocks 3.6 is out of the way, we need to think
>>> about
>>> > >> what the next version will look like.
>>> >
>>> > >> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0
>>> release and
>>> > >> support mocking dynamic variables, but while this is still on the
>>> planning
>>> > >> board, I think that it is much more important to stop and take a
>>> look at
>>> > >> where Rhino Mocks is now and where we would like it to be.
>>> >
>>> > >> I started Rhino Mocks about 5 years ago, and the codebase has stood
>>> well
>>> > >> in the test of time. There aren’t any nasty places and we can keep
>>> releasing
>>> > >> new features with no major issues.
>>> >
>>> > >> However, 5 years ago the community perception of mocking was
>>> different
>>> > >> than what it is now. Rhino Mocks hasn’t really changed significantly
>>> since
>>> > >> it 1.1 days, for that matte

[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
I don't see a reason to drop backward comp in 4.1A full point version
release is a good place to do it.

On Tue, Sep 1, 2009 at 9:56 PM, Jason Meckley wrote:

>
> Alex, a simpler API would lower the entry level. But lets also not
> forget (as much as we want to) the entry level for .net development is
> "where is the IDE Wizard?"
> that said moving the old syntax to another namespace still makes the
> option available and can confuse the developer. If you're trying to
> reduce the surface area, and reduce friction; move the old
> functionality to another assembly (Rhino.Mocks.OldSchool.dll). This
> way the user needs 2 assemblies for backwards compatibility. moving
> forward (4.1?) Rhino.Mocks.OldSchool.dll is dropped altogether.
>
> On Sep 1, 12:55 pm, Alex McMahon  wrote:
> > I think a good goal is to reduce the barrier to entry of Rhino Mocks.
> > I see a lot of questions being asked on the mailing list that are a
> > result of new users trying to get to grips with the tooling and
> > wandering down paths that lead to the same common errors, e.g. mixing
> > different syntaxes together.
> >
> > If we can achieve this without losing any functionality or syntaxes
> > then that seems ok, but the default and easiest exploration path
> > should be limited to the chosen syntax (AAA).
> >
> > Perhaps this means moving all the classes relating to older syntaxes
> > into a different namespace (Rhino.Mocks.Interop? probably a better
> > name would be needed) so people can upgrade to 4.0 and keep everything
> > the same by just adding a using to this namespace. Then in the main
> > namespace (Rhino.Mocks) we keep as small a surface area so that a new
> > user could pretty much get started just by using intellisense.
> >
> > When a user starts using the Interop namespace and getting it all
> > mixed up leading to asking the questions (as I'm sure some will) we
> > can say "The Interop namespace is designed only for backwards
> > compatibility scenarios, please use the Rhino.Mocks.Fake class and
> seehttp://ayende.com/wiki/Rhino+Mocks.ashxfor usage details"
> >
> > 2009/9/1 Tim Barcz :
> >
> > > Do we need to kill backwards compatibility.  I'm working on a
> patch/spike
> > > where the class Fake is used which really just calls MockRepository
> under
> > > the hood?
> >
> > > Thoughts?
> >
> > > On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien 
> wrote:
> >
> > >> This is a blog post that would show up day after tomorrow, I am
> posting it
> > >> here to get some traction in the mailing list before we make it really
> > >> public.
> >
> > >> Well, now that Rhino Mocks 3.6 is out of the way, we need to think
> about
> > >> what the next version will look like.
> >
> > >> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
> and
> > >> support mocking dynamic variables, but while this is still on the
> planning
> > >> board, I think that it is much more important to stop and take a look
> at
> > >> where Rhino Mocks is now and where we would like it to be.
> >
> > >> I started Rhino Mocks about 5 years ago, and the codebase has stood
> well
> > >> in the test of time. There aren’t any nasty places and we can keep
> releasing
> > >> new features with no major issues.
> >
> > >> However, 5 years ago the community perception of mocking was different
> > >> than what it is now. Rhino Mocks hasn’t really changed significantly
> since
> > >> it 1.1 days, for that matter, you can take a code base using Rhino
> Mocks for
> > >> .Net 1.1 and move it to Rhino Mocks 3.6 with no issues.
> >
> > >> But one of the most frequent complaints that I have heard is that
> Rhino
> > >> Mocks API has became too complex over the years, there are too many
> options
> > >> and knobs that you can turn. I know that my own style of interaction
> testing
> > >> has changed as well.
> >
> > >> The current plan for Rhino Mocks 4.0 is that we will break backward
> > >> compatibility in a big way. That means that we are going to
> drastically
> > >> simplify everything in the framework.
> >
> > >> We are still discussing this in the mailing list, but currently it
> looks
> > >> like we will go with the following route:
> >
> > >> Kill the dynamic, strict, partial and stub terminology. No one cares.
> It
> > >> is a fake.
> > 

[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
Hm, listen to my DNR from Oredev about Rhino Mocks.Specifically, to Carl
asking what Rhino Mocks is.

On Tue, Sep 1, 2009 at 10:09 PM, Tim Barcz  wrote:

> ah...yes I see...we need a Wizard (very good, let's do it!).
>
>
> On Tue, Sep 1, 2009 at 1:56 PM, Jason Meckley wrote:
>
>>
>> Alex, a simpler API would lower the entry level. But lets also not
>> forget (as much as we want to) the entry level for .net development is
>> "where is the IDE Wizard?"
>> that said moving the old syntax to another namespace still makes the
>> option available and can confuse the developer. If you're trying to
>> reduce the surface area, and reduce friction; move the old
>> functionality to another assembly (Rhino.Mocks.OldSchool.dll). This
>> way the user needs 2 assemblies for backwards compatibility. moving
>> forward (4.1?) Rhino.Mocks.OldSchool.dll is dropped altogether.
>>
>> On Sep 1, 12:55 pm, Alex McMahon  wrote:
>> > I think a good goal is to reduce the barrier to entry of Rhino Mocks.
>> > I see a lot of questions being asked on the mailing list that are a
>> > result of new users trying to get to grips with the tooling and
>> > wandering down paths that lead to the same common errors, e.g. mixing
>> > different syntaxes together.
>> >
>> > If we can achieve this without losing any functionality or syntaxes
>> > then that seems ok, but the default and easiest exploration path
>> > should be limited to the chosen syntax (AAA).
>> >
>> > Perhaps this means moving all the classes relating to older syntaxes
>> > into a different namespace (Rhino.Mocks.Interop? probably a better
>> > name would be needed) so people can upgrade to 4.0 and keep everything
>> > the same by just adding a using to this namespace. Then in the main
>> > namespace (Rhino.Mocks) we keep as small a surface area so that a new
>> > user could pretty much get started just by using intellisense.
>> >
>> > When a user starts using the Interop namespace and getting it all
>> > mixed up leading to asking the questions (as I'm sure some will) we
>> > can say "The Interop namespace is designed only for backwards
>> > compatibility scenarios, please use the Rhino.Mocks.Fake class and
>> seehttp://ayende.com/wiki/Rhino+Mocks.ashxfor usage details"
>> >
>> > 2009/9/1 Tim Barcz :
>> >
>> > > Do we need to kill backwards compatibility.  I'm working on a
>> patch/spike
>> > > where the class Fake is used which really just calls MockRepository
>> under
>> > > the hood?
>> >
>> > > Thoughts?
>> >
>> > > On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien 
>> wrote:
>> >
>> > >> This is a blog post that would show up day after tomorrow, I am
>> posting it
>> > >> here to get some traction in the mailing list before we make it
>> really
>> > >> public.
>> >
>> > >> Well, now that Rhino Mocks 3.6 is out of the way, we need to think
>> about
>> > >> what the next version will look like.
>> >
>> > >> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
>> and
>> > >> support mocking dynamic variables, but while this is still on the
>> planning
>> > >> board, I think that it is much more important to stop and take a look
>> at
>> > >> where Rhino Mocks is now and where we would like it to be.
>> >
>> > >> I started Rhino Mocks about 5 years ago, and the codebase has stood
>> well
>> > >> in the test of time. There aren’t any nasty places and we can keep
>> releasing
>> > >> new features with no major issues.
>> >
>> > >> However, 5 years ago the community perception of mocking was
>> different
>> > >> than what it is now. Rhino Mocks hasn’t really changed significantly
>> since
>> > >> it 1.1 days, for that matter, you can take a code base using Rhino
>> Mocks for
>> > >> .Net 1.1 and move it to Rhino Mocks 3.6 with no issues.
>> >
>> > >> But one of the most frequent complaints that I have heard is that
>> Rhino
>> > >> Mocks API has became too complex over the years, there are too many
>> options
>> > >> and knobs that you can turn. I know that my own style of interaction
>> testing
>> > >> has changed as well.
>> >
>> > >> The current plan for Rhino Mocks 4

[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
Oh, no. The guts are still the same. There are things there that need to
handle some very freaky situations.And they work, so no reason to touch
them.

We are talking about a plastic surgery rather than open heart surgery

On Tue, Sep 1, 2009 at 8:18 PM, Tim Barcz  wrote:

> If you're getting rid of record/replay will you still use the underlying
> "guts" or will this be a ground up rewrite?
>
>
> On Tue, Sep 1, 2009 at 11:57 AM, Ayende Rahien  wrote:
>
>> I think we can pretty much kill it. If they need backward compact, they
>> can use 3.6
>>
>> On Tue, Sep 1, 2009 at 7:19 PM, Tim Barcz  wrote:
>>
>>> Do we need to kill backwards compatibility.  I'm working on a patch/spike
>>> where the class Fake is used which really just calls MockRepository under
>>> the hood?
>>>
>>> Thoughts?
>>>
>>>
>>> On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien wrote:
>>>
>>>> This is a blog post that would show up day after tomorrow, I am posting
>>>> it here to get some traction in the mailing list before we make it really
>>>> public.
>>>>
>>>> Well, now that Rhino Mocks 3.6 is out of the way, we need to think about
>>>> what the next version will look like.
>>>>
>>>> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release
>>>> and support mocking dynamic variables, but while this is still on the
>>>> planning board, I think that it is much more important to stop and take a
>>>> look at where Rhino Mocks is now and where we would like it to be.
>>>>
>>>> I started Rhino Mocks about 5 years ago, and the codebase has stood well
>>>> in the test of time. There aren’t any nasty places and we can keep 
>>>> releasing
>>>> new features with no major issues.
>>>>
>>>> However, 5 years ago the community perception of mocking was different
>>>> than what it is now. Rhino Mocks hasn’t really changed significantly since
>>>> it 1.1 days, for that matter, you can take a code base using Rhino Mocks 
>>>> for
>>>> .Net 1.1 and move it to Rhino Mocks 3.6 with no issues.
>>>>
>>>> But one of the most frequent complaints that I have heard is that Rhino
>>>> Mocks API has became too complex over the years, there are too many options
>>>> and knobs that you can turn. I know that my own style of interaction 
>>>> testing
>>>> has changed as well.
>>>>
>>>> The current plan for Rhino Mocks 4.0 is that we will break backward
>>>> compatibility in a big way. That means that we are going to drastically
>>>> simplify everything in the framework.
>>>>
>>>> We are still discussing this in the mailing list, but currently it looks
>>>> like we will go with the following route:
>>>>
>>>>- Kill the dynamic, strict, partial and stub terminology. No one
>>>>cares. It is a fake.
>>>>- Remove the record / playback API. The AAA method is much simpler.
>>>>- Simplify mocking options, aiming at moving as much as possible
>>>>from expectation style to assert style.
>>>>- Keep as much of the current capabilities as we can. That means
>>>>that if Rhino Mocks was able to support a scenario, it should still 
>>>> support
>>>>it for the 4.0 version, hopefully in a simpler fashion.
>>>>
>>>> The end result is putting Rhino Mocks on an API diet. I am looking for
>>>> help in doing this, both in terms of suggested syntax and in terms of 
>>>> actual
>>>> patches.
>>>>
>>>> You are welcome to contribute…
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> Microsoft ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
I think we can pretty much kill it. If they need backward compact, they can
use 3.6

On Tue, Sep 1, 2009 at 7:19 PM, Tim Barcz  wrote:

> Do we need to kill backwards compatibility.  I'm working on a patch/spike
> where the class Fake is used which really just calls MockRepository under
> the hood?
>
> Thoughts?
>
>
> On Tue, Sep 1, 2009 at 10:56 AM, Ayende Rahien  wrote:
>
>> This is a blog post that would show up day after tomorrow, I am posting it
>> here to get some traction in the mailing list before we make it really
>> public.
>>
>> Well, now that Rhino Mocks 3.6 is out of the way, we need to think about
>> what the next version will look like.
>>
>> Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release and
>> support mocking dynamic variables, but while this is still on the planning
>> board, I think that it is much more important to stop and take a look at
>> where Rhino Mocks is now and where we would like it to be.
>>
>> I started Rhino Mocks about 5 years ago, and the codebase has stood well
>> in the test of time. There aren’t any nasty places and we can keep releasing
>> new features with no major issues.
>>
>> However, 5 years ago the community perception of mocking was different
>> than what it is now. Rhino Mocks hasn’t really changed significantly since
>> it 1.1 days, for that matter, you can take a code base using Rhino Mocks for
>> .Net 1.1 and move it to Rhino Mocks 3.6 with no issues.
>>
>> But one of the most frequent complaints that I have heard is that Rhino
>> Mocks API has became too complex over the years, there are too many options
>> and knobs that you can turn. I know that my own style of interaction testing
>> has changed as well.
>>
>> The current plan for Rhino Mocks 4.0 is that we will break backward
>> compatibility in a big way. That means that we are going to drastically
>> simplify everything in the framework.
>>
>> We are still discussing this in the mailing list, but currently it looks
>> like we will go with the following route:
>>
>>- Kill the dynamic, strict, partial and stub terminology. No one
>>cares. It is a fake.
>>- Remove the record / playback API. The AAA method is much simpler.
>>- Simplify mocking options, aiming at moving as much as possible from
>>expectation style to assert style.
>>- Keep as much of the current capabilities as we can. That means that
>>if Rhino Mocks was able to support a scenario, it should still support it
>>for the 4.0 version, hopefully in a simpler fashion.
>>
>> The end result is putting Rhino Mocks on an API diet. I am looking for
>> help in doing this, both in terms of suggested syntax and in terms of actual
>> patches.
>>
>> You are welcome to contribute…
>>
>>
>>
>
>
> --
> Tim Barcz
> Microsoft ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Planning for Rhino Mocks 4.0

2009-09-01 Thread Ayende Rahien
This is a blog post that would show up day after tomorrow, I am posting it
here to get some traction in the mailing list before we make it really
public.

Well, now that Rhino Mocks 3.6 is out of the way, we need to think about
what the next version will look like.

Initially, I thought to match Rhino Mocks 4.0 to the .NET 4.0 release and
support mocking dynamic variables, but while this is still on the planning
board, I think that it is much more important to stop and take a look at
where Rhino Mocks is now and where we would like it to be.

I started Rhino Mocks about 5 years ago, and the codebase has stood well in
the test of time. There aren’t any nasty places and we can keep releasing
new features with no major issues.

However, 5 years ago the community perception of mocking was different than
what it is now. Rhino Mocks hasn’t really changed significantly since it 1.1
days, for that matter, you can take a code base using Rhino Mocks for .Net
1.1 and move it to Rhino Mocks 3.6 with no issues.

But one of the most frequent complaints that I have heard is that Rhino
Mocks API has became too complex over the years, there are too many options
and knobs that you can turn. I know that my own style of interaction testing
has changed as well.

The current plan for Rhino Mocks 4.0 is that we will break backward
compatibility in a big way. That means that we are going to drastically
simplify everything in the framework.

We are still discussing this in the mailing list, but currently it looks
like we will go with the following route:

   - Kill the dynamic, strict, partial and stub terminology. No one cares.
   It is a fake.
   - Remove the record / playback API. The AAA method is much simpler.
   - Simplify mocking options, aiming at moving as much as possible from
   expectation style to assert style.
   - Keep as much of the current capabilities as we can. That means that if
   Rhino Mocks was able to support a scenario, it should still support it for
   the 4.0 version, hopefully in a simpler fashion.

The end result is putting Rhino Mocks on an API diet. I am looking for help
in doing this, both in terms of suggested syntax and in terms of actual
patches.

You are welcome to contribute…

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks explicit generic interface implementations

2009-09-01 Thread Ayende Rahien

applied, and included in the 3.6 release :-)

On Jul 23, 9:55 pm, Alexander Groß  wrote:
> On Jul 23, 8:51 pm, Ayende Rahien  wrote:
>
> > Ah, now that I actually read the code, it make sense.I'll apply it shortly.
>
> Thanks ;-)
>
> As I re-read my code it makes sense to change the test name - copy &
> paste error on my side!
>
> Alex
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Rhino Mocks 3.6 Released

2009-09-01 Thread Ayende Rahien
http://ayende.com/Blog/archive/2009/09/01/rhino-mocks-3.6.aspx

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Problem when changing the return value of a stub

2009-08-29 Thread Ayende Rahien
Repeat.Once()

On Sat, Aug 29, 2009 at 7:40 PM, DHilgarth  wrote:

>
> Hi!
>
> I started using Rhino.Mocks a few weeks ago and I am pretty happy with
> it, it's a great time saver!
>
> However, I have come across the need to change the return value of a
> method stub.
> There is a solution "out there" that involves calling BackToRecord
> (...All) on the mock object. The problem with this is, that it also
> seems to reset all events of the mocked object, losing all of its
> subscribers...
> That's actually pretty bad.
> The only way around this is to not use BackToRecord, instead, I store
> the IMethodOptions object returned by the call to Stub and call Return
> on it. Every call to Return effectivly overrides the old return value.
> The drawback is that I have to need this IMethodOptions object in the
> first place.
> It would be nice if two calls to Stub with the same parameters would
> return the same IMethodOptions instance.
>
> What do you think? Am I overseeing something?
>
> Kind regards,
>
> Daniel
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Clear mock object of received method calls

2009-08-29 Thread Ayende Rahien
BackToRecord()

On Sat, Aug 29, 2009 at 7:50 PM, DHilgarth  wrote:

>
> Hi!
>
> I have the following problem:
>
> I am passing a mock object mock1 to the ctor of my SUT.
> In this ctor the SUT calls a method A on mock1.
>
> Then I raise an event on another mock object mock2 the SUT subscribed
> to.
> In response to that event, the SUT should call the method A of mock1
> again.
>
> using mock1.AssertWasCalled will succeed, but regardless of whether
> the SUT called method A in response to the event or not.
>
> Furthermore, the SUT should call A only if a certain condition is
> true. In the test that tests that A is NOT called if the condition is
> false, I have the call to mock1.AssertWasNotCalled. This will always
> fail, because of the call to A in the ctor of the SUT.
>
> I would have to strip mock1 of all its method calls after the ctor of
> the SUT ran... How can I do this?
>
> Kind regards,
>
> Daniel
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: [rhino-tools-dev] Seems Is There A Bug Here?

2009-08-23 Thread Ayende Rahien
Tim,There is a bug all right. The default behavior now is Repeat.Any
If it wasn't, I would say that it is expected, since only the first call is
expected. But 1 & 3 should be the same.

On Mon, Aug 24, 2009 at 2:20 AM, Tim Barcz  wrote:

> There seems to be a bug in the code below however I am not sure what the
> "appropriate" behavior should be.  (I came across this about a month ago
> digging into a problem on this board).  I am willing to attempt a fix if
> there is one needed and I know what the proper behavior should be.  The code
> is very simple and provided below.
>
> I'm testing what the difference between Stub and Expect calls are on mocks
> and what happens when you call.  The output for the code below returns
> (you'll notice a "hole) where "mockFoo called" should be printed:
>
> mockFoo called
>>
>> mockFoo2 called
>> mockFoo2 called
>> mockFoo2 called
>> mockFoo2 called
>
>
> *At this point I'm not sure what the "correct" behavior should be.  Should
> Expect(
> [Test]
> public void HowManyTimesCanAFakeBeCalledAndReturnTheSameValue()
> {
> // The interesting thing here is that the first mock (mockFoo) does is
> only good for one call.
> // Something about the Arg.Is.Anything causes the return value
> to be good for only one call
> // this seems to be a bug when compared to other implementations (Stub
> allows multiple calls on the object
> // while returning the same value)
> var mockFoo = MockRepository.GenerateMock();
> var mockFoo2 = MockRepository.GenerateMock();
> var mockFoo3 = MockRepository.GenerateMock();
>
> mockFoo.Expect(x => x.Method(Arg.Is.Anything)).Return("mockFoo
> called");
> mockFoo2.Expect(x => x.Method(null)).IgnoreArguments().Return("mockFoo2
> called");
> mockFoo3.Expect(x =>
> x.Method(Arg.Is.Anything)).Return("mockFoo3 called").Repeat.Any();
>
> Debug.WriteLine(mockFoo.Method("hello"));
> Debug.WriteLine(mockFoo.Method("hello"));
>
> Debug.WriteLine(mockFoo2.Method("hello"));
> Debug.WriteLine(mockFoo2.Method("hello"));
>
> Debug.WriteLine(mockFoo2.Method("hello"));
> Debug.WriteLine(mockFoo2.Method("hello"));
> }
>
> public interface IFoo
> {
> string Method(string arg);
> }
>
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: [rhino-tools-dev] Stubs Causing Failure Reconciliation

2009-08-23 Thread Ayende Rahien
Tim,Stub _doesn't_ cause the test to fail.
What you have here is an assertion on a stub, it is different.
Mock can fail a test by just calling a method that isn't expected, that was
the intention.

And yes, they are blurry lines.
Unfortunately, backward compact means that it is going to be very hard to
change.
I think that the best alternative is to make RM 4.0 go on a diet and declare
backward compact dead there.
Adopt the suggestion of cutting the API and reducing the complexity.

Thoughts?

On Mon, Aug 24, 2009 at 2:07 AM, Tim Barcz  wrote:

> I was working on a post the difference between mocks and stubs with regard
> to how the framework treats them and I'm seeing some things which seem to be
> at odds can can (read:do) cause confusion.
>
> From the RhinoMocks wiki (http://ayende.com/Wiki/Rhino+Mocks+3.5.ashx)
>
> IMPORTANT: A stub will never cause a test to fail.
>
>
> However...
>
> A post from about a year ago (
> http://ayende.com/Blog/archive/2008/06/29/Rhino-Mocks-3.5-Design-Decisions-The-role-of-Stub-vs.aspx)
> discusses the role of a stub and a very simple test will demonstrate that in
> fact a Stub can cause a test to fail.
>
>
> [Test]
> public void Stub_and_Assert()
> {
> var stub = MockRepository.GenerateStub();
>
> stub.AssertWasCalled(x => x.Method(Arg.Is.Anything));
> }
>
> produces a failure, indicating the method was expected #1 time but was
> called #0.
>
> *What I'm seeing is that the lines between a mock and a stub are extremely
> blurry.  I am really struggling with the difference here.  I think if there
> is the ambiguity here and that is the direction of the framework, let's
> embrace it and remove the notion of mocks/stubs and call everything Fakes (a
> la Roy O.) and assert on whatever you want.  If we want the distinction
> baked into the framework then the distinction should be clear (and
> enforced).*
>
> Tim
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: An example of PropertyBehavior() using 3.5

2009-08-20 Thread Ayende Rahien
Oh, you are mixing AAA and record/replay syntax.

addressform.Stub(x=>x.FirstName);


On Wed, Aug 19, 2009 at 9:56 PM, Stephen Schaff  wrote:

>
> Ayende,
>
> Thank you for that, it clears up some confusion.
>
> Still the above code is failing at the SetupResult.For call (it never
> even gets to the Assert call).
>
> I would like to know how to make my mocks have the stub like
> PropertyBehavior (even if I can't assert on it then).
>
> On Aug 19, 12:51 pm, Ayende Rahien  wrote:
> > Stephen, If you specify PropertyBehavior, it behave like a property.
> > That means that you can't assert on calls on it.
> > If you want to check that it was set, you can check the value in it.
> >
> > On Wed, Aug 19, 2009 at 9:47 PM, Stephen Schaff 
> wrote:
> >
> > > I would really appreciate a working example of using PropertyBehavior
> > > in Rhino Mocks 3.5.
> >
> > > Here is what I have (that does not work)
> >
> > >[TestMethod]
> > >public void RandomTest()
> > >{
> > >var addressForm =
> > > MockRepository.GenerateMock();
> >
> > >SetupResult.For(addressForm.FirstName).PropertyBehavior();
> > >addressForm.FirstName = "Bob";
> > >string name = addressForm.FirstName;
> > >addressForm.AssertWasCalled(x => { var ignored =
> > > x.FirstName; });
> > >Assert.AreEqual(name, addressForm.FirstName);
> > >}
> >
> > > This uses the following Interface:
> > >public interface IAddAddressForm
> > >{
> > > string FirstName { get; set; }
> > >}
> >
> > > When I run the test I get this error:
> > > System.InvalidOperationException: Invalid call, the last call has been
> > > used or no call has been made (make sure that you are calling a
> > > virtual (C#) / Overridable (VB) method)..
> >
> > > If you know what I am doing wrong, then that would be great, but
> > > otherwise I would just love a working example of how to make a
> > > property of a mock use PropertyBehavior using 3.5 (no Replay/ReplayAll
> > > please!  There are Tons of examples using that syntax)
> >
> > > Hoping I get a response,
> > > Stephen
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Null reference error on expectations when inner property is accessed

2009-08-19 Thread Ayende Rahien
Oh, oldie...

On Thu, Aug 20, 2009 at 12:00 AM, Tim Barcz  wrote:

>
> http://ayende.com/wiki/GetFile.aspx?File=Rhino+Mocks+3.3+Quick+Reference.pdf
>
>
> On Wed, Aug 19, 2009 at 2:17 PM, Ayende Rahien  wrote:
>
>> _What_ PDF?
>>
>> On Wed, Aug 19, 2009 at 9:31 PM, Tim Barcz  wrote:
>>
>>> PDF ?= RhinoMocks 3.3 documents
>>> (Slaps forhead remembering he was going to update document to 3.5 syntax)
>>>
>>> On Tue, Aug 18, 2009 at 7:02 PM, TheMightyKumquat 
>>> wrote:
>>>
>>>>
>>>> OK, now that I see it works, I will code it that way from now on. But
>>>> what I'm curious about is that the PDF you download with Rhino Mocks
>>>> dll instructs you to mock the setting of a property as follows.
>>>>
>>>> //expect a setter to be called (value unimportant)
>>>> axis.Position = 0.56;
>>>> LastCall.IgnoreArguments(); //use LastCall to set expectation details
>>>>
>>>> My test fails with exactly that syntax, and it only passes if I change
>>>> the syntax to that for a property Get - that is, to
>>>> Expect.Call(x.myProperty).Return(mockedProperty)
>>>>
>>>> So the pdf is wrong?
>>>>
>>>>
>>>
>>>
>>> --
>>> Tim Barcz
>>> ASPInsider
>>> http://timbarcz.devlicio.us
>>> http://www.twitter.com/timbarcz
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: An example of PropertyBehavior() using 3.5

2009-08-19 Thread Ayende Rahien
IAddAddresForm - presumably an interface

On Wed, Aug 19, 2009 at 10:06 PM, Tim Barcz  wrote:

> Is the property virtual?
> Also have you looked at GenerateStub where PropertyBehavior is the default
> behavior?
>
>
> On Wed, Aug 19, 2009 at 1:47 PM, Stephen Schaff  wrote:
>
>>
>> I would really appreciate a working example of using PropertyBehavior
>> in Rhino Mocks 3.5.
>>
>> Here is what I have (that does not work)
>>
>>[TestMethod]
>>public void RandomTest()
>>{
>>var addressForm =
>> MockRepository.GenerateMock();
>>
>>SetupResult.For(addressForm.FirstName).PropertyBehavior();
>>addressForm.FirstName = "Bob";
>>string name = addressForm.FirstName;
>>addressForm.AssertWasCalled(x => { var ignored =
>> x.FirstName; });
>>Assert.AreEqual(name, addressForm.FirstName);
>>}
>>
>>
>> This uses the following Interface:
>>public interface IAddAddressForm
>>{
>> string FirstName { get; set; }
>>}
>>
>> When I run the test I get this error:
>> System.InvalidOperationException: Invalid call, the last call has been
>> used or no call has been made (make sure that you are calling a
>> virtual (C#) / Overridable (VB) method)..
>>
>> If you know what I am doing wrong, then that would be great, but
>> otherwise I would just love a working example of how to make a
>> property of a mock use PropertyBehavior using 3.5 (no Replay/ReplayAll
>> please!  There are Tons of examples using that syntax)
>>
>> Hoping I get a response,
>> Stephen
>>
>>
>>
>>
>
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Null reference error on expectations when inner property is accessed

2009-08-19 Thread Ayende Rahien
_What_ PDF?

On Wed, Aug 19, 2009 at 9:31 PM, Tim Barcz  wrote:

> PDF ?= RhinoMocks 3.3 documents
> (Slaps forhead remembering he was going to update document to 3.5 syntax)
>
> On Tue, Aug 18, 2009 at 7:02 PM, TheMightyKumquat wrote:
>
>>
>> OK, now that I see it works, I will code it that way from now on. But
>> what I'm curious about is that the PDF you download with Rhino Mocks
>> dll instructs you to mock the setting of a property as follows.
>>
>> //expect a setter to be called (value unimportant)
>> axis.Position = 0.56;
>> LastCall.IgnoreArguments(); //use LastCall to set expectation details
>>
>> My test fails with exactly that syntax, and it only passes if I change
>> the syntax to that for a property Get - that is, to
>> Expect.Call(x.myProperty).Return(mockedProperty)
>>
>> So the pdf is wrong?
>>
>>
>
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: An example of PropertyBehavior() using 3.5

2009-08-19 Thread Ayende Rahien
Stephen, If you specify PropertyBehavior, it behave like a property.
That means that you can't assert on calls on it.
If you want to check that it was set, you can check the value in it.

On Wed, Aug 19, 2009 at 9:47 PM, Stephen Schaff  wrote:

>
> I would really appreciate a working example of using PropertyBehavior
> in Rhino Mocks 3.5.
>
> Here is what I have (that does not work)
>
>[TestMethod]
>public void RandomTest()
>{
>var addressForm =
> MockRepository.GenerateMock();
>
>SetupResult.For(addressForm.FirstName).PropertyBehavior();
>addressForm.FirstName = "Bob";
>string name = addressForm.FirstName;
>addressForm.AssertWasCalled(x => { var ignored =
> x.FirstName; });
>Assert.AreEqual(name, addressForm.FirstName);
>}
>
>
> This uses the following Interface:
>public interface IAddAddressForm
>{
> string FirstName { get; set; }
>}
>
> When I run the test I get this error:
> System.InvalidOperationException: Invalid call, the last call has been
> used or no call has been made (make sure that you are calling a
> virtual (C#) / Overridable (VB) method)..
>
> If you know what I am doing wrong, then that would be great, but
> otherwise I would just love a working example of how to make a
> property of a mock use PropertyBehavior using 3.5 (no Replay/ReplayAll
> please!  There are Tons of examples using that syntax)
>
> Hoping I get a response,
> Stephen
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Any plans for future versions of Rhino Mocks?

2009-08-19 Thread Ayende Rahien
Alex,_Maybe_, for 4.0

On Wed, Aug 19, 2009 at 5:33 PM, Alex McMahon  wrote:

> I remember a thread a little while ago discussing some sort of cut-down
> Rhino Mocks version, where all the old syntaxes are removed, and just the
> AAA syntax is taken forward. Is this something likely to happen Ayende?
>
> 2009/8/19 Ayende Rahien 
>
> I looked at it, but I don't really see the point, to tell you the truth. We
>> already have a really nice syntax for doing property sets (just set the
>> property :-) ), and the rest isn't something really interesting.
>>
>>
>> On Wed, Aug 19, 2009 at 4:18 PM, Chris Missal wrote:
>>
>>> Does anybody have any thoughts on adding something like Linq to Moq has?
>>> It seems cool, but I haven't seen the need for something like this yet.
>>> http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/13/164978.aspx
>>> <http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/13/164978.aspx>
>>>
>>> On Wed, Aug 19, 2009 at 2:37 AM, Ayende Rahien wrote:
>>>
>>>> Dennis,Rhino Mocks is still active, yes.
>>>> I am actually happy that I am not one of the major contributers, it
>>>> indicates the maturity of the project.
>>>> And yes, I want to release 3.6 sometimes soon, with a bunch of bug fixes
>>>> since 3.5
>>>>
>>>>
>>>> On Wed, Aug 19, 2009 at 10:33 AM, dennisdoomen <
>>>> dennis.doo...@avivasolutions.nl> wrote:
>>>>
>>>>>
>>>>> Are there any plans to continue developing Rhino Mocks in the near
>>>>> future? The most recent change by Ayende dates back 6 months. Or
>>>>> should I shift my focus to alternatives like MOQ?
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Chris Missal
>>> http://chrismissal.lostechies.com/
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Any plans for future versions of Rhino Mocks?

2009-08-19 Thread Ayende Rahien
I looked at it, but I don't really see the point, to tell you the truth. We
already have a really nice syntax for doing property sets (just set the
property :-) ), and the rest isn't something really interesting.

On Wed, Aug 19, 2009 at 4:18 PM, Chris Missal wrote:

> Does anybody have any thoughts on adding something like Linq to Moq has? It
> seems cool, but I haven't seen the need for something like this yet.
> http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/13/164978.aspx
> <http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/13/164978.aspx>
>
> On Wed, Aug 19, 2009 at 2:37 AM, Ayende Rahien  wrote:
>
>> Dennis,Rhino Mocks is still active, yes.
>> I am actually happy that I am not one of the major contributers, it
>> indicates the maturity of the project.
>> And yes, I want to release 3.6 sometimes soon, with a bunch of bug fixes
>> since 3.5
>>
>>
>> On Wed, Aug 19, 2009 at 10:33 AM, dennisdoomen <
>> dennis.doo...@avivasolutions.nl> wrote:
>>
>>>
>>> Are there any plans to continue developing Rhino Mocks in the near
>>> future? The most recent change by Ayende dates back 6 months. Or
>>> should I shift my focus to alternatives like MOQ?
>>>
>>>
>>
>>
>>
>
>
> --
> Chris Missal
> http://chrismissal.lostechies.com/
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Any plans for future versions of Rhino Mocks?

2009-08-19 Thread Ayende Rahien
Dennis,Rhino Mocks is still active, yes.
I am actually happy that I am not one of the major contributers, it
indicates the maturity of the project.
And yes, I want to release 3.6 sometimes soon, with a bunch of bug fixes
since 3.5

On Wed, Aug 19, 2009 at 10:33 AM, dennisdoomen <
dennis.doo...@avivasolutions.nl> wrote:

>
> Are there any plans to continue developing Rhino Mocks in the near
> future? The most recent change by Ayende dates back 6 months. Or
> should I shift my focus to alternatives like MOQ?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to rhinomocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Feature request: Add more detailed information to ExpectationViolationException for constraint violations

2009-08-13 Thread Ayende Rahien
Patch would be  welcome.

On Fri, Aug 14, 2009 at 8:23 AM, Rory  wrote:

>
> I have some unit tests which expect several constrains on a method. If
> one of the constraints fail, it is impossible to know which one is the
> issue based on the message of the thrown exception.
>
> It would be good if this message could be updated to indicate either
> the value tested along with the value expected or even better,
> indicate which constraint failed?.
>
> Cheers,
>
> Rory
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: partial mock not correctly doing 'Repeat.Once()'

2009-08-11 Thread Ayende Rahien
No, it is a request for getting a patch, actually

On Wed, Aug 12, 2009 at 3:07 AM, Ben M  wrote:

>
> oh good, you're going to put it in the next patch, sweet!  :-)
>
> On Aug 11, 5:04 pm, Ayende Rahien  wrote:
> > Patch :-)
> >
> > On Wed, Aug 12, 2009 at 3:01 AM, Ben M  wrote:
> >
> > > oic.  Well would it be worthwhile to consider adding an alternative
> > > mode to support this or perhaps the following syntax?
> >
> > > Expect.Call(publisher.Send(null)).Permit.Once()
> >
> > > :)
> >
> > > thx
> > > Ben
> >
> > > On Aug 11, 4:38 pm, Ayende Rahien  wrote:
> > > > Ben,Partial work in a very specific way, if a method is not
> intercepted,
> > > it
> > > > is expected that the real object will get it.
> > > > As such, Repeat.Once() indicate how often this should be repeated,
> not
> > > that
> > > > only one call is permitted.
> >
> > > > On Wed, Aug 12, 2009 at 2:12 AM, Ben M  wrote:
> >
> > > > > yes, but doesnt this sort of defeat the purpose of using
> Repeat.Once
> > > > > ()?
> >
> > > > > i mean if i'm using a strict or dynamic mock then i can use
> Repeat.Once
> > > > > () in this way, why then can i not do this w/ a partial?
> >
> > > > > On Aug 11, 4:08 pm, Ayende Rahien  wrote:
> > > > > > Make a second call:
> > > > > >  Expect.Call(_publisher.Send(null))
> >
> > > > > > > .IgnoreArguments()
> > > > > > > .Return(true)
> > > > > > > .Repeat.*Never()*;
> > > > > > On Wed, Aug 12, 2009 at 2:05 AM, Ben M 
> wrote:
> >
> > > > > > > well, i made a discovery on this.  If you only tell it to
> repeat
> > > once,
> > > > > > > then the other calls will subsequently go to the actual real
> method
> > > as
> > > > > > > opposed to the mock version of the method.  So I've done a work
> > > around
> > > > > > > using Expect.Call().Do() and keeping my own count of the number
> of
> > > > > > > calls, but this is something that in my opinion I should be
> able to
> > > do
> > > > > > > in Rhino mocks.  Does anyone know how to do this without having
> to
> > > do
> > > > > > > it myself?  Ayende?
> >
> > > > > > > On Aug 11, 2:48 pm, Ben M  wrote:
> > > > > > > > I have a partial mock on a class I'll call 'Publisher'
> >
> > > > > > > > the publisher has a method called 'Publish' that in turn
> calls a
> > > > > > > > virtual method called Send as follows:
> >
> > > > > > > > public class Publisher
> > > > > > > > {
> > > > > > > >  public bool Publish(MyList list)
> > > > > > > >  {
> > > > > > > >   string msg = _msgBuilder.BuildFrom(list);
> > > > > > > >   bool success = Send(msg);
> >
> > > > > > > >   return success;
> > > > > > > > }
> >
> > > > > > > >  public virtual bool Send(string msg)
> > > > > > > >  {
> > > > > > > > /// snip
> > > > > > > >return true;
> > > > > > > >   }
> >
> > > > > > > > }
> >
> > > > > > > > my unit test then does the following:
> > > > > > > > [SetUp]
> > > > > > > > public void Setup()
> > > > > > > > {
> >
> > > > > > > > _mocks = new MockRepository();
> >
> > > > > > > > _publisher = _mocks.PartialMock();
> >
> > > > > > > > }
> >
> > > > > > > > [Test]
> > > > > > > > public void OnlyCallSendOnceForEmptyLists()
> > > > > > > > {
> > > > > > > > Expect.Call(_publisher.Send(null))
> > > > > > > > .IgnoreArguments()
> > > > > > > > .Return(true)
> > > > > > > > .Repeat.Once;
> >
> > > > > > > > _mocks.ReplayAll();
> >
> > > > > > > > _publisher.Publish(new MyList());
> > > > > > > > _publisher.Publish(new MyList());
> >
> > > > > > > > _mocks.VerifyAll();
> >
> > > > > > > > }
> >
> > > > > > > > I would expect this test to fail as it should be expecting no
> > > more
> > > > > > > > than 1 call, but the test is passing, and stepping thru the
> > > debugger
> > > > > I
> > > > > > > > can see it IS in fact making 2 calls, yet the test still
> passes.
> > > > >  What
> > > > > > > > am I doing wrong that causes this test to give me a false
> > > positive?
> >
> > > > > > > > thanks in advance
> > > > > > > > Ben
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: partial mock not correctly doing 'Repeat.Once()'

2009-08-11 Thread Ayende Rahien
Patch :-)

On Wed, Aug 12, 2009 at 3:01 AM, Ben M  wrote:

>
> oic.  Well would it be worthwhile to consider adding an alternative
> mode to support this or perhaps the following syntax?
>
> Expect.Call(publisher.Send(null)).Permit.Once()
>
> :)
>
> thx
> Ben
>
> On Aug 11, 4:38 pm, Ayende Rahien  wrote:
> > Ben,Partial work in a very specific way, if a method is not intercepted,
> it
> > is expected that the real object will get it.
> > As such, Repeat.Once() indicate how often this should be repeated, not
> that
> > only one call is permitted.
> >
> > On Wed, Aug 12, 2009 at 2:12 AM, Ben M  wrote:
> >
> > > yes, but doesnt this sort of defeat the purpose of using Repeat.Once
> > > ()?
> >
> > > i mean if i'm using a strict or dynamic mock then i can use Repeat.Once
> > > () in this way, why then can i not do this w/ a partial?
> >
> > > On Aug 11, 4:08 pm, Ayende Rahien  wrote:
> > > > Make a second call:
> > > >  Expect.Call(_publisher.Send(null))
> >
> > > > > .IgnoreArguments()
> > > > > .Return(true)
> > > > > .Repeat.*Never()*;
> > > > On Wed, Aug 12, 2009 at 2:05 AM, Ben M  wrote:
> >
> > > > > well, i made a discovery on this.  If you only tell it to repeat
> once,
> > > > > then the other calls will subsequently go to the actual real method
> as
> > > > > opposed to the mock version of the method.  So I've done a work
> around
> > > > > using Expect.Call().Do() and keeping my own count of the number of
> > > > > calls, but this is something that in my opinion I should be able to
> do
> > > > > in Rhino mocks.  Does anyone know how to do this without having to
> do
> > > > > it myself?  Ayende?
> >
> > > > > On Aug 11, 2:48 pm, Ben M  wrote:
> > > > > > I have a partial mock on a class I'll call 'Publisher'
> >
> > > > > > the publisher has a method called 'Publish' that in turn calls a
> > > > > > virtual method called Send as follows:
> >
> > > > > > public class Publisher
> > > > > > {
> > > > > >  public bool Publish(MyList list)
> > > > > >  {
> > > > > >   string msg = _msgBuilder.BuildFrom(list);
> > > > > >   bool success = Send(msg);
> >
> > > > > >   return success;
> > > > > > }
> >
> > > > > >  public virtual bool Send(string msg)
> > > > > >  {
> > > > > > /// snip
> > > > > >return true;
> > > > > >   }
> >
> > > > > > }
> >
> > > > > > my unit test then does the following:
> > > > > > [SetUp]
> > > > > > public void Setup()
> > > > > > {
> >
> > > > > > _mocks = new MockRepository();
> >
> > > > > > _publisher = _mocks.PartialMock();
> >
> > > > > > }
> >
> > > > > > [Test]
> > > > > > public void OnlyCallSendOnceForEmptyLists()
> > > > > > {
> > > > > > Expect.Call(_publisher.Send(null))
> > > > > > .IgnoreArguments()
> > > > > > .Return(true)
> > > > > > .Repeat.Once;
> >
> > > > > > _mocks.ReplayAll();
> >
> > > > > > _publisher.Publish(new MyList());
> > > > > > _publisher.Publish(new MyList());
> >
> > > > > > _mocks.VerifyAll();
> >
> > > > > > }
> >
> > > > > > I would expect this test to fail as it should be expecting no
> more
> > > > > > than 1 call, but the test is passing, and stepping thru the
> debugger
> > > I
> > > > > > can see it IS in fact making 2 calls, yet the test still passes.
> > >  What
> > > > > > am I doing wrong that causes this test to give me a false
> positive?
> >
> > > > > > thanks in advance
> > > > > > Ben
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: partial mock not correctly doing 'Repeat.Once()'

2009-08-11 Thread Ayende Rahien
Ben,Partial work in a very specific way, if a method is not intercepted, it
is expected that the real object will get it.
As such, Repeat.Once() indicate how often this should be repeated, not that
only one call is permitted.

On Wed, Aug 12, 2009 at 2:12 AM, Ben M  wrote:

>
> yes, but doesnt this sort of defeat the purpose of using Repeat.Once
> ()?
>
> i mean if i'm using a strict or dynamic mock then i can use Repeat.Once
> () in this way, why then can i not do this w/ a partial?
>
> On Aug 11, 4:08 pm, Ayende Rahien  wrote:
> > Make a second call:
> >  Expect.Call(_publisher.Send(null))
> >
> > > .IgnoreArguments()
> > > .Return(true)
> > > .Repeat.*Never()*;
> > On Wed, Aug 12, 2009 at 2:05 AM, Ben M  wrote:
> >
> > > well, i made a discovery on this.  If you only tell it to repeat once,
> > > then the other calls will subsequently go to the actual real method as
> > > opposed to the mock version of the method.  So I've done a work around
> > > using Expect.Call().Do() and keeping my own count of the number of
> > > calls, but this is something that in my opinion I should be able to do
> > > in Rhino mocks.  Does anyone know how to do this without having to do
> > > it myself?  Ayende?
> >
> > > On Aug 11, 2:48 pm, Ben M  wrote:
> > > > I have a partial mock on a class I'll call 'Publisher'
> >
> > > > the publisher has a method called 'Publish' that in turn calls a
> > > > virtual method called Send as follows:
> >
> > > > public class Publisher
> > > > {
> > > >  public bool Publish(MyList list)
> > > >  {
> > > >   string msg = _msgBuilder.BuildFrom(list);
> > > >   bool success = Send(msg);
> >
> > > >   return success;
> > > > }
> >
> > > >  public virtual bool Send(string msg)
> > > >  {
> > > > /// snip
> > > >return true;
> > > >   }
> >
> > > > }
> >
> > > > my unit test then does the following:
> > > > [SetUp]
> > > > public void Setup()
> > > > {
> >
> > > > _mocks = new MockRepository();
> >
> > > > _publisher = _mocks.PartialMock();
> >
> > > > }
> >
> > > > [Test]
> > > > public void OnlyCallSendOnceForEmptyLists()
> > > > {
> > > > Expect.Call(_publisher.Send(null))
> > > > .IgnoreArguments()
> > > > .Return(true)
> > > > .Repeat.Once;
> >
> > > > _mocks.ReplayAll();
> >
> > > > _publisher.Publish(new MyList());
> > > > _publisher.Publish(new MyList());
> >
> > > > _mocks.VerifyAll();
> >
> > > > }
> >
> > > > I would expect this test to fail as it should be expecting no more
> > > > than 1 call, but the test is passing, and stepping thru the debugger
> I
> > > > can see it IS in fact making 2 calls, yet the test still passes.
>  What
> > > > am I doing wrong that causes this test to give me a false positive?
> >
> > > > thanks in advance
> > > > Ben
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: partial mock not correctly doing 'Repeat.Once()'

2009-08-11 Thread Ayende Rahien
Make a second call:
 Expect.Call(_publisher.Send(null))
> .IgnoreArguments()
> .Return(true)
> .Repeat.*Never()*;

On Wed, Aug 12, 2009 at 2:05 AM, Ben M  wrote:

>
> well, i made a discovery on this.  If you only tell it to repeat once,
> then the other calls will subsequently go to the actual real method as
> opposed to the mock version of the method.  So I've done a work around
> using Expect.Call().Do() and keeping my own count of the number of
> calls, but this is something that in my opinion I should be able to do
> in Rhino mocks.  Does anyone know how to do this without having to do
> it myself?  Ayende?
>
> On Aug 11, 2:48 pm, Ben M  wrote:
> > I have a partial mock on a class I'll call 'Publisher'
> >
> > the publisher has a method called 'Publish' that in turn calls a
> > virtual method called Send as follows:
> >
> > public class Publisher
> > {
> >  public bool Publish(MyList list)
> >  {
> >   string msg = _msgBuilder.BuildFrom(list);
> >   bool success = Send(msg);
> >
> >   return success;
> > }
> >
> >  public virtual bool Send(string msg)
> >  {
> > /// snip
> >return true;
> >   }
> >
> > }
> >
> > my unit test then does the following:
> > [SetUp]
> > public void Setup()
> > {
> >
> > _mocks = new MockRepository();
> >
> > _publisher = _mocks.PartialMock();
> >
> > }
> >
> > [Test]
> > public void OnlyCallSendOnceForEmptyLists()
> > {
> > Expect.Call(_publisher.Send(null))
> > .IgnoreArguments()
> > .Return(true)
> > .Repeat.Once;
> >
> > _mocks.ReplayAll();
> >
> > _publisher.Publish(new MyList());
> > _publisher.Publish(new MyList());
> >
> > _mocks.VerifyAll();
> >
> > }
> >
> > I would expect this test to fail as it should be expecting no more
> > than 1 call, but the test is passing, and stepping thru the debugger I
> > can see it IS in fact making 2 calls, yet the test still passes.  What
> > am I doing wrong that causes this test to give me a false positive?
> >
> > thanks in advance
> > Ben
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Mocking events

2009-08-08 Thread Ayende Rahien
You created a property with a delegate as its type public interface IView
   {
   *event *EventHandler SaveEventHandler{get;set;}
   }

On Sat, Aug 8, 2009 at 7:43 PM, shapovalov  wrote:

>
> Thanks Chris,
> I seen this example,
> But I had error in my View code.
> Insead of this
>  public interface IView
>{
>event EventHandler SaveEventHandler;
>}
>
> I used this code, and have error. I am new with events :)
>  public interface IView
>{
>EventHandler SaveEventHandler{get;set;}
> }
>
> On 8 авг, 09:33, Chris Missal  wrote:
> > Check this page out:
> http://ayende.com/Wiki/Rhino+Mocks+3.5.ashx#Howtoraiseevents
> >
> > [Test]
> > public void RaisingEventOnViewUsingExtensionMethod()
> > {
> >var mocks = new MockRepository();
> >IView view = mocks.DynamicMock();
> >Presenter p = new Presenter(view);
> >
> >view.Raise(x => x.Load += null, this, EventArgs.Empty);
> >
> >Assert.IsTrue(p.OnLoadCalled);
> >
> >
> >
> > }
> > On Fri, Aug 7, 2009 at 11:59 PM, shapovalov 
> wrote:
> >
> > > Hi,
> >
> > > I want to mock events in my MVP application
> > > I have this code
> >
> > >IToolbar toolbar = Mocks.StrictMock();
> > >toolbar.SaveEventHandler += null;
> > >IEventRaiser raiser = LastCall.IgnoreArguments
> > > ().GetEventRaiser(); //exception here
> >
> > > But I have exception
> > > System.InvalidOperationException: Previous method
> > > 'IToolbar.get_SaveEventHandler();' requires a return value or an
> > > exception to throw.
> >
> > > I can't understand what is wrong. Should I return somthing?.
> >
> > > Does anybody can help me to understand it?
> > > How can I use mocking for events in Rhino Mocks 3.5. All examples than
> > > I tryed was not working.
> >
> > --
> > Chris Missalhttp://chrismissal.lostechies.com/
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Problems with event raising on interfaces defined by interop COM wrappers

2009-08-06 Thread Ayende Rahien
Yes, there is. I just need a few quite hours for this.

2009/8/6 haifisch 

>
> Krzystof you are right - the problem seems to be the specialname
> attribute. However, the problem seems to be fixed in the trunk (with
> svn# 1722/1725 on 13./14. Nov. 2008) - but i'm using the latest
> released version 3.5.0.1337.
>
> Are there any plans for a service release 3.5.1?
> If you take a look at the subversion log it seems that a lot of issues
> have been fixed since the last release in Oct. 2008.
>
> Best regards,
>
> Andreas Ländle
>
> On 5 Aug., 14:09, Krzysztof Koźmic (2)  wrote:
> > I guess this is related to fact that COM properties/events dont have
> > (or not always have... donno) specialname attribute. So I think RM
> > treats them as normal methods.
> > When you implement the interface in C# class, the event is on the
> > class, so it does have specialname so RM is able to pick it up as
> > event subscription method.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Where're my posts?

2009-08-05 Thread Ayende Rahien
They were waiting for moderation

On Wed, Aug 5, 2009 at 10:23 AM, ben.biddington wrote:

>
> Hi,
>
> I've re-subscribed to this list and tried posting twice -- any ideas
> where my messages're going?
>
> If they get moderated out, how can I tell?
>
> P.S. I can't find a similar question anywhere.
>
> 
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Unexpected method call on mocked class

2009-07-30 Thread Ayende Rahien
Are they virtual method calls?

On Wed, Jul 29, 2009 at 11:13 AM, Malda  wrote:

>
> Is there a way how to force throw exception on unexpected method call
> on mocked class ? It`s working on mocked interfaces but on mocked
> classes unexpected method calls are ignored.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks caches return values

2009-07-29 Thread Ayende Rahien
Please write it up :-)

On Thu, Jul 30, 2009 at 1:25 AM, Tim Barcz  wrote:

> I had a blog post at one point written about this and trhew it out because
> I figured no one would be interested.
>
> I can safely say there would've been at least one person interested.
>
> Tim
>
> On Wed, Jul 29, 2009 at 5:22 PM, Ayende Rahien  wrote:
>
>> Try WhenCalled
>>
>>
>> On Thu, Jul 30, 2009 at 12:54 AM, jsearles  wrote:
>>
>>>
>>> I notice that when returning a value from mock, that value is cached.
>>> For example, the following always return the same value:
>>>
>>> mock.Expect(m => m.Current).Return(DateTime.Now).Repeat.Any();
>>>
>>> This makes sense - you're returning a value, not an invocation. I can
>>> get around this by explicitly setting the expected value before each
>>> expected call to it, but this is a hassle as well as error prone. Is
>>> there a way to cause the return value to invoke a method to retrieve a
>>> value on each call. I'm imagining something like:
>>>
>>> mock.Expect(m => m.Current).Return(() => DateTime.Now);
>>>
>>> Thanks!
>>>
>>> Josh
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks caches return values

2009-07-29 Thread Ayende Rahien
Try WhenCalled

On Thu, Jul 30, 2009 at 12:54 AM, jsearles  wrote:

>
> I notice that when returning a value from mock, that value is cached.
> For example, the following always return the same value:
>
> mock.Expect(m => m.Current).Return(DateTime.Now).Repeat.Any();
>
> This makes sense - you're returning a value, not an invocation. I can
> get around this by explicitly setting the expected value before each
> expected call to it, but this is a hassle as well as error prone. Is
> there a way to cause the return value to invoke a method to retrieve a
> value on each call. I'm imagining something like:
>
> mock.Expect(m => m.Current).Return(() => DateTime.Now);
>
> Thanks!
>
> Josh
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks explicit generic interface implementations

2009-07-23 Thread Ayende Rahien
Ah, now that I actually read the code, it make sense.I'll apply it shortly.

2009/7/23 Alexander Groß 

>
> On Jul 23, 8:36 pm, Ayende Rahien  wrote:
> > Explicit interface impl. cannot be mocked, they are not virtual
>
> In the sample I am stubbing an interface that inherits from the same
> generic interfaces twice. Also, it works with the patch in place which
> makes me wonder why this should not work after all.
>
> Then again, I wonder why Rhino Mocks silently stubs the first
> interface's member and throws an InvalidCastException only when
> accessing the second interface's member, which should not be possible
> w.r.t. to your statement above.
>
> Alex
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks explicit generic interface implementations

2009-07-23 Thread Ayende Rahien
Explicit interface impl. cannot be mocked, they are not virtual

2009/7/23 Alexander Groß 

>
> Hi all,
>
> While writing a unit test today I found that Rhino Mocks seems to mix
> up properties of stubs that have expliclit interface implementations.
> In my SUT I set these properties after casting the stub (that has
> multiple implementations of the same interface) to a specific
> interface. It's pretty simple, see here for the code:
> http://gist.github.com/150458
>
> To reproduce:
> 1. Debug the test above
> 2. Add watch ((IDoSomethingWith)doer).DoSomething
> 3. Add watch ((IDoSomethingWith)doer).DoSomething
> 4. Set a breakpoint to ((IDoSomethingWith)doer).DoSomething
> += 
> 5. Run to the breakpoint
> 6. Step over the breakpoint and note that:
> a) ((IDoSomethingWith)doer).DoSomething is set
> b) ((IDoSomethingWith)doer).DoSomething throws an
> InvalidCastException
> 7. The second assignment in the ctor will fail the test
>
> I would like to know if that is intended behavior. If it's not (the
> code runs fine in scenarios without stubs), please consider my patch:
> http://gist.github.com/150466
>
> Thanks,
>
> Alex
>
> X-Post from rhino-tools-dev
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: rhinomocks 3.5 source?

2009-07-23 Thread Ayende Rahien
I don't generally create tags for releases, look at the release date an get
the trunk from there.

On Thu, Jul 23, 2009 at 8:17 PM, Kenneth Xu  wrote:

>
> Scott, correct me if I'm wrong, but I think what Scott is looking for
> is the source code that corresponds to the released binary of 3.5. It
> is important so that people can step into the RM code when debugging,
> If they get the head of the trunk, the source code would be different.
>
> This is usually archived by create a tag in SVN for the specific
> version of trunk. Another alternative is to let Scott know what
> revision of the trunk corresponds to the RM 3.5 release binary.
>
> Just my 2 cents
>
> On Thu, Jul 23, 2009 at 10:02 AM, Tim Barcz wrote:
> > 3.5 is located in the trunk. (you're in the right place)
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Unable to set expectation on object's property - connected with Generics?

2009-07-23 Thread Ayende Rahien

On the face of it, it looks right.
Please create a small test project to show the problem

On Jul 22, 5:46 am, TheMightyKumquat  wrote:
> I have an app written in the Model-View-Presenter pattern that I'm
> testing. I am getting an exception in my test code at run-time for the
> Presenter: "previous method requires a return value or an exception to
> throw." This is associated with a Controller class that is a property
> of the Presenter. The Controller is defined with generics. I'm both a
> novice with Generics and with Rhino Mocks, and I’m stumped as to how I
> can fix this error. Can anyone help, please?
>
> The class I'm testing:
> Public Class ClientSearchResultsPresenter
>         Inherits Presenter(Of IClientSearchResultsView)
>
>         Public Sub New( ByVal controller As
> IClientSearchController)
>
>             _controller = controller
>         End Sub
>
>         Private _controller As IClientSearchController
>         Public ReadOnly Property Controller() As
> IClientSearchController
>             Get
>                 Return _controller
>             End Get
>         End Property
>
>         Public Overrides Sub OnViewLoaded()
>
>             AddHandler View.SelectedIndexChanged, AddressOf
> View_SelectedIndexChanged
>             AddHandler View.SelectedPageChanged, AddressOf
> View_SelectedPageChanged
>
>             LoadSummaryOnView()
>             View.SelectedPage = Controller.SelectedPage
>         End Sub
>
>         Private Sub View_SelectedIndexChanged(ByVal sender As Object,
> ByVal e As EventArgs)
>
>             Controller.SetSelectedSearchResult(View.SelectedIndex)
>         End Sub
>
>         Private Sub View_SelectedPageChanged(ByVal sender As Object,
> ByVal e As EventArgs)
>
>             Controller.SelectedPage = View.SelectedPage
>         End Sub
>
>         Private Sub LoadSummaryOnView()
>
>             View.Summary =
> Controller.SummaryDocument.ClientSearchSummaryFieldsCollection
>         End Sub
>
>     End Class
>
> The test code:
>     _
>     Public Sub ClientSearchResultsPresenter_OnViewLoadedTest()
>         ' OnViewLoaded in the presenter does the following:
>         ' - adds event handlers for the View's SelectedIndexChanged
> and SelectedPageChanged events
>         ' - calls the private function LoadSummaryOnView, which calls
> a Controller method and assigns the result to the View.Summary
> property in the presenter
>         ' -  sets the View.SelectedPage property to the
> Controller.SelectedPage property.
>
>         ' Mock a controller
>         Dim mockController As IClientSearchController
>         mockController = mocks.StrictMock(Of IClientSearchController)
> ()
>         Dim target As ClientSearchResultsPresenter = New
> ClientSearchResultsPresenter(mockController)
>
>         ' when the presenter calls its LoadKeyOnView method, it will
> assign to the View.Summary property. Set up expectation for this write-
> only property
>         Dim fakeSummary As New ClientSearchSummaryDocument()
>         fakeSummary.ClientSearchSummaryFieldsCollection.Add(New
> ClientSearchSummaryDocument.ClientSearchSummaryFieldsDocument())
>
>         ' The onViewLoaded method will access a method on the
> presenter's View property,
>         ' so we need to mock one up.
>         Dim mockView As IClientSearchResultsView
>         mockView = mocks.StrictMock(Of IClientSearchResultsView)()
>
>         ' set up expectation that during the test, the Presenter being
> tested will add a
>         ' handler to the View's events and that this event handler
> will not be null
>         AddHandler mockView.SelectedIndexChanged, Nothing
>         LastCall.Constraints(Rhino.Mocks.Constraints.Is.NotNull())
>         AddHandler mockView.SelectedPageChanged, Nothing
>         LastCall.Constraints(Rhino.Mocks.Constraints.Is.NotNull())
>
>         ' set up expectation that view.Summary will be written to
>         mockView.Summary =
> fakeSummary.ClientSearchSummaryFieldsCollection
>
>         ' set expectation that View.SelectedPage will be called
>         Rhino.Mocks.Expect.Call(mockView.SelectedPage).Return(0)
>         ' set expectation that Controller.SelectedPage will be called
>         Rhino.Mocks.Expect.Call(mockController.SelectedPage).Return(0)
>
>         target.View = mockView
>
>         ' set expectation that controller's property will be called -
> ERROR OCCURS HERE
> Rhino.Mocks.Expect.Call(mockController.SummaryDocument).Return
> (fakeSummary)
>
>         mocks.ReplayAll()
>
>         target.OnViewLoaded()
>
>         ' verify that all expectations set up for this test have been
> met on all mock objects
>         mocks.VerifyAll()
>         Assert.IsTrue(target.View.SelectedPage =
> target.Controller.SelectedPage)
>
>     End Sub
>
> The error message can mean that you’ve forgotten to call Replay on the
> object you’re setting the expectation 
> on.http://codemonkey.nmonta.com/2008/09/19/previous-method-requires-a-re...
> Not the case here – I’ve got ReplayAll

[RhinoMocks] Re: Unable to pass null value into mock if original class has constructor with one parameter

2009-07-21 Thread Ayende Rahien
That is because the way C# behaves in this situation, you need to use
new[]{null} instead

On Tue, Jul 21, 2009 at 1:50 AM, Alexey Diyan wrote:

>
> Hi,
>
> I am using Rhino.Mocks 3.5, assembly version is 3.5.0.1337.
> Try to mock class with constructor which has one parameter.
> When I pass one null-value into method MockRepository.GenerateMock
> (params object[]) I have got following exception:
> "MissingMethodException: Can't find a constructor with matching
> arguments"
>
> When I cast this null-value to actual type everything works fine.
> When I pass two or more null-values (without any type casting)
> everything works fine.
>
>
>
> You can cut and paste unit tests below:
>
> public class CtorWithOneParam
> {
>   private string _first;
>
>   public CtorWithOneParam(string first)
>   {
>   _first = first;
>   }
>
>   public virtual string FooMethod()
>   {
>   return _first;
>   }
> }
>
> public class CtorWithTwoParams
> {
>   private string _first;
>   private string _second;
>
>   public CtorWithTwoParams(string first, string second)
>   {
>   _first = first;
>   _second = second;
>   }
>
>   public virtual string FooMethod()
>   {
>   return _first + _second;
>   }
> }
>
> public class CtorWithThreeParams
> {
>   private string _first;
>   private string _second;
>   private string _third;
>
>   public CtorWithThreeParams(string first, string second, string
> third)
>   {
>   _first = first;
>   _second = second;
>   _third = third;
>   }
>
>   public virtual string FooMethod()
>   {
>   return _first + _second + _third;
>   }
> }
>
> [TestFixture]
> public class TestClassMocking
> {
>   [Test]
>   public void TestCtorWithOneParamWhichEqualsToNull() // Failed
> test
>   {
>   var result =
> MockRepository.GenerateMock(null);
>   Assert.IsNotNull(result);
>   }
>
>   [Test]
>   public void TestCtorWithOneParamWhichHasKnownTypeEqualsToNull()
>   {
>   var result =
> MockRepository.GenerateMock((string)
> null);
>   Assert.IsNotNull(result);
>   }
>
>   [Test]
>   public void TestCtorWithOneParamWhichHasKnownType()
>   {
>   var result =
> MockRepository.GenerateMock
> (string.Empty);
>   Assert.IsNotNull(result);
>   }
>
>   [Test]
>   public void TestCtorWithTwoParams()
>   {
>   var result =
> MockRepository.GenerateMock(null,
> null);
>   Assert.IsNotNull(result);
>   }
>
>   [Test]
>   public void TestCtorWithThreeParams()
>   {
>   var result =
> MockRepository.GenerateMock(null,
> null, null);
>   Assert.IsNotNull(result);
>   }
> }
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Trying to return from non-virtual method gives wrong error.

2009-07-16 Thread Ayende Rahien
Can you post a test case?

On Thu, Jul 16, 2009 at 5:00 PM, Shane C  wrote:

>
> If I have a non-virtual method on a class that I am stub I get the
> following error when I try to stub a return in.
>
> System.InvalidOperationException: You are trying to set an expectation
> on a property that was defined to use PropertyBehavior.
> Instead of writing code such as this: mockObject.Stub(x =>
> x.SomeProperty).Return(42);
> You can use the property directly to achieve the same result:
> mockObject.SomeProperty = 42;
>
> This is the wrong message since it's not a property at all.  The
> problem was that the method wasn't virtual.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhinomock with Silverlight

2009-07-12 Thread Ayende Rahien
what was the problem?

On Fri, Jul 10, 2009 at 4:27 PM, DV  wrote:

>
> I have a silverlight app implemeneted using MVVM pattern. Do you have
> any sample to use Rhinomock for testing this?
>
> I refered this
>
> http://silverlight.net/blogs/justinangel/archive/2009/02/25/silverlight-unit-testing-rhinomocks-unity-and-resharper.aspx
>
> But i did not get it worked for my app.
>
> Please help.
>
> Thanks in advance
> Devika
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino mocks 3.3 casting mock interface to parent interface

2009-06-29 Thread Ayende Rahien
Please create a test case for this, what you describe should not be possible

On Tue, Jun 30, 2009 at 9:10 AM, Matthew Evans wrote:

>
> I have a small issue i havent been able to find any documentation on.
> Using 3.3 I am creating a mock object say IMyObject.
> IMyObject inherits from IMyParentObject. Now somewhere in the code the
> mock object is being cast as IMyParentObject and return a null.
>
> My question is how do I prepare a mock to deal with castings implicit
> and explicit?
> Thanks.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Ordered expectations for AAA syntax

2009-06-23 Thread Ayende Rahien
You cannot use Ordered with AAA, that was judged to be rare enough and the
complexity of providing this feature high enough to not do it.

On Tue, Jun 23, 2009 at 1:02 PM, Alex McMahon  wrote:

>
> I've found doing ordered expectations to be a bit of a pain since
> Rhino Mocks 3.5 introduced AAA syntax, it seems to be one of the few
> areas where you have to drop back to using the old record/replay
> syntax, and it's making my test fixtures awfully complicated and
> fragile.
>
> So other than trying to find a nice way to do it in RhinoMocks itself
> I've got a workaround that I've been using, and I wondered what others
> thought of it.
>
> [TestMethod()]
> public void ViewTitleSetBeforeShownInWorkspace()
> {
>  //arrange
>  var mockView=MockRepository.GenerateMock();
>  bool viewTitleSet=false;
>  mockView.Stub(x=>x.Title=Arg.Is.Anything)
>.WhenCalled(a=>{viewTitleSet=true});
>  mockView.Stub(x=>x.ShowInWorkspace("MyWorkspace"))
>.WhenCalled(a=>{Assert.IsTrue(viewTitleSet, "View title should
> have been set first");});
>
>  //act
>  var target=new Presenter(mockView);
>  target.Initialize();
>
>  //assert
>  mockView.AssertWasCalled(x=>x.ShowInWorkspace("MyWorkspace"));
> }
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Pure Equals fails on Mock

2009-05-22 Thread Ayende Rahien
Try this with:
public class BusinessTransaction
{
   public override Equals(object other)
   {
 return RefereceEquals(this,other);
}
}

You'll see what hpapns

On Fri, May 22, 2009 at 10:21 PM, Tim Barcz  wrote:

> [Test]
> public void Equality()
> {
> var mock = MockRepository.GenerateMock();
>
> Assert.IsTrue(mock.Equals(mock));
>
> }
>
> On Fri, May 22, 2009 at 4:17 PM, Ayende Rahien  wrote:
>
>> You were using ==
>>
>>
>> On Fri, May 22, 2009 at 10:13 PM, Tim Barcz  wrote:
>>
>>> Why did mine pass?
>>>
>>>
>>> On Fri, May 22, 2009 at 4:09 PM, Ayende Rahien wrote:
>>>
>>>> that is the expected behavior if you overrode equals
>>>>
>>>>
>>>> On Fri, May 22, 2009 at 10:05 PM, Shane Courtrille <
>>>> shanecourtri...@gmail.com> wrote:
>>>>
>>>>> NUnit but it's not the assert that fails.  I have code that does an
>>>>> Equals check and fails.  If I add a m_SourceBT.Stub(stub =>
>>>>> stub.Equals(m_SourceBT)).Return(true); everything works good.
>>>>>
>>>>>
>>>>> On Fri, May 22, 2009 at 2:49 PM, Tim Barcz  wrote:
>>>>>
>>>>>> Shane,
>>>>>>
>>>>>> This works for me.
>>>>>>
>>>>>> What unit test framework are you using?
>>>>>>
>>>>>> On Fri, May 22, 2009 at 9:44 AM, Shane C 
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>> The following assertion fails...
>>>>>>>
>>>>>>> m_SourceBT = MockRepository.GenerateMock();
>>>>>>>
>>>>>>> Assert.IsTrue(m_SourceBT.Equals(m_SourceBT));
>>>>>>>
>>>>>>> I assume this is failing by design but I can't really understand why
>>>>>>> it would?  Does anyone know anything about this?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Shane
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Pure Equals fails on Mock

2009-05-22 Thread Ayende Rahien
You were using ==

On Fri, May 22, 2009 at 10:13 PM, Tim Barcz  wrote:

> Why did mine pass?
>
>
> On Fri, May 22, 2009 at 4:09 PM, Ayende Rahien  wrote:
>
>> that is the expected behavior if you overrode equals
>>
>>
>> On Fri, May 22, 2009 at 10:05 PM, Shane Courtrille <
>> shanecourtri...@gmail.com> wrote:
>>
>>> NUnit but it's not the assert that fails.  I have code that does an
>>> Equals check and fails.  If I add a m_SourceBT.Stub(stub =>
>>> stub.Equals(m_SourceBT)).Return(true); everything works good.
>>>
>>>
>>> On Fri, May 22, 2009 at 2:49 PM, Tim Barcz  wrote:
>>>
>>>> Shane,
>>>>
>>>> This works for me.
>>>>
>>>> What unit test framework are you using?
>>>>
>>>> On Fri, May 22, 2009 at 9:44 AM, Shane C wrote:
>>>>
>>>>>
>>>>> The following assertion fails...
>>>>>
>>>>> m_SourceBT = MockRepository.GenerateMock();
>>>>>
>>>>> Assert.IsTrue(m_SourceBT.Equals(m_SourceBT));
>>>>>
>>>>> I assume this is failing by design but I can't really understand why
>>>>> it would?  Does anyone know anything about this?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Shane
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Pure Equals fails on Mock

2009-05-22 Thread Ayende Rahien
that is the expected behavior if you overrode equals

On Fri, May 22, 2009 at 10:05 PM, Shane Courtrille <
shanecourtri...@gmail.com> wrote:

> NUnit but it's not the assert that fails.  I have code that does an Equals
> check and fails.  If I add a m_SourceBT.Stub(stub =>
> stub.Equals(m_SourceBT)).Return(true); everything works good.
>
>
> On Fri, May 22, 2009 at 2:49 PM, Tim Barcz  wrote:
>
>> Shane,
>>
>> This works for me.
>>
>> What unit test framework are you using?
>>
>> On Fri, May 22, 2009 at 9:44 AM, Shane C wrote:
>>
>>>
>>> The following assertion fails...
>>>
>>> m_SourceBT = MockRepository.GenerateMock();
>>>
>>> Assert.IsTrue(m_SourceBT.Equals(m_SourceBT));
>>>
>>> I assume this is failing by design but I can't really understand why
>>> it would?  Does anyone know anything about this?
>>>
>>> Thanks,
>>>
>>> Shane
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Inconsistent Arg.Matches (.Net / Silverlight)

2009-05-16 Thread Ayende Rahien
Than I would appreciate a patch for this.

On Sat, May 16, 2009 at 9:12 AM,  wrote:

>  Thank you for your quick response.
>
> According to the msdn-docs for silverlight:
> http://msdn.microsoft.com/en-us/library/bb335710(VS.95).aspx
> Yes
>
>
>
>  *From:* Ayende Rahien 
> *Sent:* Saturday, May 16, 2009 10:04 AM
> *To:* RhinoMocks@googlegroups.com
> *Subject:* [RhinoMocks] Re: Inconsistent Arg.Matches (.Net / Silverlight)
>
> Does silverlight have Expression?
>
> On Sat, May 16, 2009 at 8:50 AM, Paulsen  wrote:
>
>>
>> Hi,
>>
>> currently I am developing with the Composite Application Guidance for
>> WPF and Silverlight.
>> While testing I noticed that the method Arg.Matches in Rhino Mocks
>> has different layout in the Silverlight / .Net version.
>>
>> .Net:
>> public static T Matches(Expression> predicate);
>>
>> Silverlight:
>> public static T Matches(Predicate predicate);
>>
>> So writing
>>
>> obj.AssertWasCalled(x => x.PropertyChangedEventHandler
>> (Arg.Is.Anything, Arg.Matches(y =>
>> y.PropertyName == "Property")));
>>
>> failed in Silverlight.
>>
>> I had to write
>>
>> Predicate pred = y => y.PropertyName ==
>> "Property";
>> obj.AssertWasCalled(x => x.PropertyChangedEventHandler
>> (Arg.Is.Anything, Arg.Matches
>> (pred)));
>>
>> that failed to compile in non Silverlight environment.
>>
>> I would like to use one test code for both environments. Is this
>> method layout difference a mistake?
>>
>> Thank you!
>> Paulsen
>>
>>
>>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Inconsistent Arg.Matches (.Net / Silverlight)

2009-05-16 Thread Ayende Rahien
Does silverlight have Expression?

On Sat, May 16, 2009 at 8:50 AM, Paulsen  wrote:

>
> Hi,
>
> currently I am developing with the Composite Application Guidance for
> WPF and Silverlight.
> While testing I noticed that the method Arg.Matches in Rhino Mocks
> has different layout in the Silverlight / .Net version.
>
> .Net:
> public static T Matches(Expression> predicate);
>
> Silverlight:
> public static T Matches(Predicate predicate);
>
> So writing
>
> obj.AssertWasCalled(x => x.PropertyChangedEventHandler
> (Arg.Is.Anything, Arg.Matches(y =>
> y.PropertyName == "Property")));
>
> failed in Silverlight.
>
> I had to write
>
> Predicate pred = y => y.PropertyName ==
> "Property";
> obj.AssertWasCalled(x => x.PropertyChangedEventHandler
> (Arg.Is.Anything, Arg.Matches
> (pred)));
>
> that failed to compile in non Silverlight environment.
>
> I would like to use one test code for both environments. Is this
> method layout difference a mistake?
>
> Thank you!
> Paulsen
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Book recommendations

2009-05-15 Thread Ayende Rahien
Release It!
On Fri, May 15, 2009 at 9:13 AM, Peter Morris  wrote:

> A very kind person has just sent me £100 in Amazon book tokens for helping
> him with a problem - so now I want some book recommendations.
>
> I don't mind which language the books are based on *if* they teach
> concepts, otherwise I would prefer C# books.
>
> Books I already have
> The Pragmatic Programmer
> Concurrent Programming on Windows
> Core J2EE Patterns
> NHibernate in Action
> Jon Skeet's C# in Depth
> Domain Driven Design by Eric Evans (Didn't like Nilsson's book)
> Patterns of Enterprise Application Architecture
> What Every Programmer Should Know About Object-Oriented Design
>
> I might buy Oren's "DSL in Boo" book to try to get an idea what kind of
> benefits I'd get from a DSL, but that leaves me with plenty more to spend.
>
> I'd appreciate recommendations so that I can browse through the table of
> contents and see if I like the look of them.  I thought I'd ask in this
> group because anyone who writes unit tests and mocks obviously has the same
> desire to write good software that I do :-)
>
> Thanks
>
> Pete
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks and sealed classes

2009-04-30 Thread Ayende Rahien
Mandel,If you want to work with SP, I strongly recommend TypeMock.
Rhino Mocks cannot mock sealed classes or statics, and TM make working with
SP testing _much_ easier.
There is even a reduced price version to work just with SP.

On Thu, Apr 30, 2009 at 3:06 PM, Mandel  wrote:

>
> Hello there,
>
> I am working on a team that is currently developing for SharePoint. We
> want to make a dcition in whic mocking library we should use. We are
> between TypeMock and Rhino.
>
> I would much more (and the rest of the team) to use rhino but we do
> not know if we would be able to work with Rhino and sealed classes. Is
> that possible?
>
> Kr,
>
> manuel => mandel
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Generic Interface Crash

2009-04-27 Thread Ayende Rahien
Damn!I hoped that it was fixed in SP2.
I guess it was a transient fix :-(

On Mon, Apr 27, 2009 at 7:01 PM, Shane Courtrille  wrote:

> No.  He is using .Net 3.0 SP 1 and does not crash.  We are using .Net 3.0
> SP 2 and do crash.
>
> On Mon, Apr 27, 2009 at 10:00 AM, Ayende Rahien  wrote:
>
>> So it is fixed with SP2?
>>
>>
>> On Mon, Apr 27, 2009 at 6:56 PM, Shane Courtrille <
>> shanecourtri...@gmail.com> wrote:
>>
>>> He has SP 1 and we have SP 2.  We've modified the interface to be less
>>> generic.
>>>
>>> On Mon, Apr 27, 2009 at 9:50 AM, Ayende Rahien wrote:
>>>
>>>> what version of the runtime are you running this on? including SP1
>>>> It is a long standing bug with Reflection Emit relating to generic
>>>> constraints that relate to one another.
>>>>
>>>>
>>>> On Mon, Apr 27, 2009 at 6:42 PM, Shane C wrote:
>>>>
>>>>>
>>>>> We have a machine where this actually works fine so we're confused.
>>>>>
>>>>> On Apr 27, 9:39 am, Shane C  wrote:
>>>>> > Is this the CLR bug that was hot fixed or is there some sort of
>>>>> > guidance as to what we shouldn't be doing?
>>>>> >
>>>>> > On Apr 27, 9:36 am, Ayende Rahien  wrote:
>>>>> >
>>>>> > > It is a known issue when you have complex generic constraints.The
>>>>> root issue
>>>>> > > is a CLR bug.
>>>>> >
>>>>> > > On Mon, Apr 27, 2009 at 6:33 PM, Shane C <
>>>>> shanecourtri...@gmail.com> wrote:
>>>>> >
>>>>> > > > We have an interface that looks like this...
>>>>> >
>>>>> > > > public interface IKennel : IKennel where T : IDog
>>>>> > > > {
>>>>> > > >  void DoSomething(TDog dog) where TDog : IDog;
>>>>> > > > }
>>>>> >
>>>>> > > > This interface when mocked causes NUnit to crash.  Unfortunately
>>>>> NUnit
>>>>> > > > doesn't want to reveal the type of exception that is occuring
>>>>> beyond
>>>>> > > > the fact it's a win32 exception.  Is this a known issue or has
>>>>> anyone
>>>>> > > > seen this?
>>>>> >
>>>>> > > > I wanted to double check before creating a test case...
>>>>> >
>>>>> >
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Generic Interface Crash

2009-04-27 Thread Ayende Rahien
So it is fixed with SP2?

On Mon, Apr 27, 2009 at 6:56 PM, Shane Courtrille  wrote:

> He has SP 1 and we have SP 2.  We've modified the interface to be less
> generic.
>
> On Mon, Apr 27, 2009 at 9:50 AM, Ayende Rahien  wrote:
>
>> what version of the runtime are you running this on? including SP1
>> It is a long standing bug with Reflection Emit relating to generic
>> constraints that relate to one another.
>>
>>
>> On Mon, Apr 27, 2009 at 6:42 PM, Shane C wrote:
>>
>>>
>>> We have a machine where this actually works fine so we're confused.
>>>
>>> On Apr 27, 9:39 am, Shane C  wrote:
>>> > Is this the CLR bug that was hot fixed or is there some sort of
>>> > guidance as to what we shouldn't be doing?
>>> >
>>> > On Apr 27, 9:36 am, Ayende Rahien  wrote:
>>> >
>>> > > It is a known issue when you have complex generic constraints.The
>>> root issue
>>> > > is a CLR bug.
>>> >
>>> > > On Mon, Apr 27, 2009 at 6:33 PM, Shane C 
>>> wrote:
>>> >
>>> > > > We have an interface that looks like this...
>>> >
>>> > > > public interface IKennel : IKennel where T : IDog
>>> > > > {
>>> > > >  void DoSomething(TDog dog) where TDog : IDog;
>>> > > > }
>>> >
>>> > > > This interface when mocked causes NUnit to crash.  Unfortunately
>>> NUnit
>>> > > > doesn't want to reveal the type of exception that is occuring
>>> beyond
>>> > > > the fact it's a win32 exception.  Is this a known issue or has
>>> anyone
>>> > > > seen this?
>>> >
>>> > > > I wanted to double check before creating a test case...
>>> >
>>> >
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Generic Interface Crash

2009-04-27 Thread Ayende Rahien
what version of the runtime are you running this on? including SP1
It is a long standing bug with Reflection Emit relating to generic
constraints that relate to one another.

On Mon, Apr 27, 2009 at 6:42 PM, Shane C  wrote:

>
> We have a machine where this actually works fine so we're confused.
>
> On Apr 27, 9:39 am, Shane C  wrote:
> > Is this the CLR bug that was hot fixed or is there some sort of
> > guidance as to what we shouldn't be doing?
> >
> > On Apr 27, 9:36 am, Ayende Rahien  wrote:
> >
> > > It is a known issue when you have complex generic constraints.The root
> issue
> > > is a CLR bug.
> >
> > > On Mon, Apr 27, 2009 at 6:33 PM, Shane C 
> wrote:
> >
> > > > We have an interface that looks like this...
> >
> > > > public interface IKennel : IKennel where T : IDog
> > > > {
> > > >  void DoSomething(TDog dog) where TDog : IDog;
> > > > }
> >
> > > > This interface when mocked causes NUnit to crash.  Unfortunately
> NUnit
> > > > doesn't want to reveal the type of exception that is occuring beyond
> > > > the fact it's a win32 exception.  Is this a known issue or has anyone
> > > > seen this?
> >
> > > > I wanted to double check before creating a test case...
> >
> >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Generic Interface Crash

2009-04-27 Thread Ayende Rahien
It is a known issue when you have complex generic constraints.The root issue
is a CLR bug.

On Mon, Apr 27, 2009 at 6:33 PM, Shane C  wrote:

>
> We have an interface that looks like this...
>
> public interface IKennel : IKennel where T : IDog
> {
>  void DoSomething(TDog dog) where TDog : IDog;
> }
>
> This interface when mocked causes NUnit to crash.  Unfortunately NUnit
> doesn't want to reveal the type of exception that is occuring beyond
> the fact it's a win32 exception.  Is this a known issue or has anyone
> seen this?
>
> I wanted to double check before creating a test case...
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: TypeLoadException when trying to SetupResult.For() on generic method with constraints

2009-04-21 Thread Ayende Rahien
I think that you hit a CLR bug, we have run into that before.What version of
the runtime? what Rhino Mocks version?

On Tue, Apr 21, 2009 at 3:16 PM, Johan Andersson  wrote:

>
> Hi, I'm getting an error when setting up expectations, which only
> occurs when debugging tests with MSTest:
> Test method threw exception:  System.TypeLoadException:
> GenericArguments[0], 'IContract', on
>
> 'IHandlerFactoryProxy4818bd1ca30942439444b38aefb5d180+InvocationCreateHandler_13
> [TContentType]' violates the constraint of type parameter
> 'TContentType'..
>
> Test setup:
> SetupResult.For( _handlerFactory.CreateHandler() ).Return
> ( _contractHandler );
>
> Interface:
> IHandler CreateHandler();
>
> _contractHandler is declared as IContractHandler which in turn is:
>
> interface IContractHandler: IHandler
>
> This error only occurs when running the test in the debugger.
> I'm not sure why the error mentions a type parameter TContentType -
> it's not in the declaration.
>
> Any ideas where to start looking to solve this problem?
> Thanks in advance!
>
> - Johan
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Expect parameter of object type

2009-04-19 Thread Ayende Rahien
Use composite constraints.
Arg.Is.Anything && Arg.Match(x=> x.PRoperty = "a');

On Sun, Apr 19, 2009 at 12:06 PM, Peter Morris  wrote:

>
> > Arg.Is.Anything ??
>
> That only satisfies as far as
>
>  Expect
>ValidateStringNotNull
>WithASingleParameter of type ValidateStringNotNullArgs
> (BrokenConstraints)
>
> and completely missed out
>
>Where BrokenConstraints is anything
>And Where FieldName property == "Salutation"
>And Where ValueToCheck == "X"
>
>
> Any other ideas?
>
>
> Pete
> 
> http://mrpmorris.blogspot.com
> http://www.AlterEgos.com - Who do you want to be?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Expect parameter of object type

2009-04-18 Thread Ayende Rahien
Arg.Is.Anything ??

On Sat, Apr 18, 2009 at 11:49 PM, Peter Morris  wrote:

>
> At the moment I have the following
>
> constraintFactory.Expect(x =>
> x.ValidateStringNotNull(Arg>.Is.Anything,
> Arg.Is("Salutation"), Arg.Is("X")));
>
> This expects a call of
>IConstraintFactory.ValidateStringNotNull(brokenConstraints,
> "Salutation", "X");
>
> If I were to change my parameters to an object, as we do with EventArgs
>
> public class ValidateStringNotNullArgs
> {
>public IList BrokenConstraints { get; }
>public string FieldName { get; }
>public string ValueToCheck { get; }
>
>//constructor omitted
> }
>
> How would I validate the argument in the mock then?  In English I need to
> say
>
> Expect
>ValidateStringNotNull
>WithASingleParameter of type ValidateStringNotNullArgs
>Where BrokenConstraints is anything
>And Where FieldName property == "Salutation"
>And Where ValueToCheck == "X"
>
> I hope that makes sense, and that it is possible :-)
>
> Regards
>
> Pete
> 
> http://mrpmorris.blogspot.com
> http://www.AlterEgos.com - Who do you want to be?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: more than 1 call to a stub method

2009-04-02 Thread Ayende Rahien
please produce sample code

On Thu, Apr 2, 2009 at 5:16 AM, Jax  wrote:

>
> I have the following stub:
>
> ServiceMock.Stub(x => x.GetRecordsAsync(null)).Constraints(Is.Anything
> ()).WhenCalled(OnGetRecordsCompleted(Service));
>
> The OnGetRecordsCompleted wasn't being called the 2nd time
> GetRecordsAsynch was called from the test, so I added:
> ServiceMock.Stub(x => x.GetRecordsAsync(null)).Constraints(Is.Anything
> ()).WhenCalled(OnGetRecordsCompleted(Service)).Repeat.Any;
>
> ...but this still doesn't seem to work.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: PATCH: Lambda Constraint

2009-03-15 Thread Ayende Rahien
Can you send this as an attachment?

On Thu, Mar 12, 2009 at 3:48 PM, Thejuan  wrote:

>
> Following on from
> http://groups.google.com/group/RhinoMocks/browse_thread/thread/293e25d9a3abeed1
>
> Here is a patch to fix the problem I’m having and an illustrative test
> (the test doesn’t show a proper use case just the tests issue)
>
>
>
> I also took some liberties with the Expression in LambdaConstraint. I
> converted it to a LambdaExpression, it made my patch easier but it’s
> not necessary. It didn’t seem to break anything though and makes the
> Invoke,Compile and parameter check nicer.
>
>
> Adam
> (I can mail the patch if it gets messed up)
>
>
> Index: Rhino.Mocks.Tests/StubAllTest.cs
> ===
> --- Rhino.Mocks.Tests/StubAllTest.cs(revision 2086)
> +++ Rhino.Mocks.Tests/StubAllTest.cs(working copy)
> @@ -150,6 +150,17 @@
>Assert.IsTrue(fish.IsFreshWater);
>}
>
> +[Test]
> +public void StubCanHandlePolymorphicArgConstraints()
> +{
> +IAquarium aquarium =
> MockRepository.GenerateStub();
> +aquarium.Stub(x => x.DetermineAge(Arg.Matches
> (arg => arg.Planet == "mars"))).Return(100);
> +aquarium.Stub(x => x.DetermineAge
> (Arg.Is.TypeOf)).Return(5);
> +
> +Assert.IsFalse(typeof(MartianFish).IsAssignableFrom(typeof
> (SpecificFish)));
> +Assert.AreEqual(5, aquarium.DetermineAge(new SpecificFish
> ()));
> +}
> +
>}
>
>public interface ICat : IAnimal
> @@ -179,6 +190,13 @@
>}
>}
>
> +
> +
> +public interface IAquarium
> +{
> +int DetermineAge(IFish fish);
> +}
> +
>public interface IFish
>{
>bool IsFreshWater { get; set; }
> @@ -189,6 +207,12 @@
>public abstract bool IsFreshWater { get; set; }
>}
>
> +public class MartianFish : IFish
> +{
> +public bool IsFreshWater { get; set; }
> +public string Planet { get; set; }
> +}
> +
>public class SpecificFish : Fish
>{
>private bool _isFreshWater;
> Index: Rhino.Mocks/Constraints/Constraints.cs
> ===
> --- Rhino.Mocks/Constraints/Constraints.cs  (revision 2086)
> +++ Rhino.Mocks/Constraints/Constraints.cs  (working copy)
> @@ -380,13 +380,13 @@
>/// 
> public class LambdaConstraint : AbstractConstraint
> {
> -private readonly Expression expr;
> +private readonly LambdaExpression expr;
>
>/// 
>/// Initializes a new instance of the  cref="LambdaConstraint"/
> > class.
>/// 
>/// The expr.
> -public LambdaConstraint(Expression expr)
> +public LambdaConstraint(LambdaExpression expr)
> {
> this.expr = expr;
> }
> @@ -398,11 +398,25 @@
>/// 
> public override bool Eval(object obj)
> {
> -Delegate pred = (Delegate)expr.GetType().GetMethod
> ("Compile").Invoke(expr, new object[0]);
> -return (bool) pred.DynamicInvoke(obj);
> +if (!IsArgumentTypeIsAssignableFrom(expr, obj))
> +return false;
> +
> +return (bool)expr.Compile().DynamicInvoke(obj);
> }
>
> -   /// 
> +private bool IsArgumentTypeIsAssignableFrom(LambdaExpression
> predicate, object obj)
> +{
> +if(obj != null)
> +{
> +if (!predicate.Parameters[0].Type.IsAssignableFrom
> (obj.GetType()))
> +{
> +return false;
> +}
> +}
> +return true;
> +}
> +
> +/// 
>/// Gets the message for this constraint
>/// 
>/// 
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Are there committers on this project other than Ayende?

2009-03-12 Thread Ayende Rahien
Yes

On Thu, Mar 12, 2009 at 2:11 PM, Thejuan  wrote:

>
> I have a patch to submit. Do I submit it here?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Mocking for objects not created by mock repository

2009-03-02 Thread Ayende Rahien
Can you give me a concrete example?

On Mon, Mar 2, 2009 at 10:22 AM, Daniel Fernandes <
goo...@danielfernandes.net> wrote:

>
> Let's say this instance can then be used to construct another object
> that would take a considerable (relatively) amount of time to create
> with a mock framework.
> The example I was using was simplistic I would agree and therefore
> should not warrant this feature.
> Daniel
>
>
> On Mar 2, 5:50 pm, Ayende Rahien  wrote:
> > Since the mock will only affect the returned instance, what is the
> benefit
> > thi
> >
> > On Mon, Mar 2, 2009 at 8:48 AM, Daniel Fernandes <
> goo...@danielfernandes.net
> >
> > > wrote:
> >
> > > I sent an email to Oren about this and he's asked me to put this on
> > > the Mailing List. My bad.
> >
> > > One of my colleagues had an interesting problem, he's a Ruby developer
> > > combined with C# experience and he wanted to use Rhino Mocks to mock
> > > an existing instance of a type without having to create that type with
> > > the mock repository.
> >
> > > So the example I sent to Oren was like this:
> >
> > > public interface IFoo
> > > {
> > >  void Bar();
> > > }
> > > public class Foo : IFoo {
> > >  void Bar(){}
> > > }
> >
> > > Let's say I can already create this Foo and it's fine as it is, I
> > > would like now to easily intercept calls such as IFoo.Bar() in this
> > > occasion.
> > > I know I can create a type deriving from Foo and then add a mean to
> > > spy calls made to it but I'd like to do this in code and I think Rhino
> > > Mocks with the feature set already supported should support such use
> > > case pretty easily.
> >
> > > Use case:
> > > [Test]
> > > public void ShouldCallBarTwiceOnly() {
> > > var foo = new Foo();
> > > var mockedFoo = mocks.InstanceMock(Foo);
> > > using (mocks.Record()) {
> > >mockedFoo.Expect.Call(x => x.Bar()).Repeat.Twice();
> > > }
> > > using (mocks.Playback()) {
> > >mockedFoo.Bar();
> > >mockedFoo.Bar();
> > > }
> > > }
> >
> > > Daniel
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Mocking for objects not created by mock repository

2009-03-02 Thread Ayende Rahien
Since the mock will only affect the returned instance, what is the benefit
thi

On Mon, Mar 2, 2009 at 8:48 AM, Daniel Fernandes  wrote:

>
> I sent an email to Oren about this and he's asked me to put this on
> the Mailing List. My bad.
>
> One of my colleagues had an interesting problem, he's a Ruby developer
> combined with C# experience and he wanted to use Rhino Mocks to mock
> an existing instance of a type without having to create that type with
> the mock repository.
>
> So the example I sent to Oren was like this:
>
> public interface IFoo
> {
>  void Bar();
> }
> public class Foo : IFoo {
>  void Bar(){}
> }
>
> Let's say I can already create this Foo and it's fine as it is, I
> would like now to easily intercept calls such as IFoo.Bar() in this
> occasion.
> I know I can create a type deriving from Foo and then add a mean to
> spy calls made to it but I'd like to do this in code and I think Rhino
> Mocks with the feature set already supported should support such use
> case pretty easily.
>
> Use case:
> [Test]
> public void ShouldCallBarTwiceOnly() {
> var foo = new Foo();
> var mockedFoo = mocks.InstanceMock(Foo);
> using (mocks.Record()) {
>mockedFoo.Expect.Call(x => x.Bar()).Repeat.Twice();
> }
> using (mocks.Playback()) {
>mockedFoo.Bar();
>mockedFoo.Bar();
> }
> }
>
>
> Daniel
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Setting Constraints for NHibernate Projections

2009-03-01 Thread Ayende Rahien
It is not the same instance

On Sun, Mar 1, 2009 at 3:10 PM, aeden.jame...@gmail.com <
aeden.jame...@gmail.com> wrote:

>
> I have the following test
>
>[Test]
>public void CorrectProjectionSetForCount()
>{
>IProjection RowCountProjection = Projections.RowCountInt64
> ();
>
>using (Mocker.Record())
>{
>Expect.Call(NHibernateCriteria.SetProjection
> (RowCountProjection))
>   .Return(NHibernateCriteria);
>}
>using (Mocker.Playback())
>{
>long RowCount = TestQuery.Count;
>}
>}
>
> which fails with the message
>
> Rhino.Mocks.Exceptions.ExpectationViolationException :
>   ICriteria.SetProjection(count(*)); Expected #0, Actual #1.
>   ICriteria.SetProjection(count(*)); Expected #1, Actual #0.
>
> I've seen this in the past with NHibernate Expressions and worked
> around it with the AllPropertiesMatch constraint, but that's not doing
> the trick here.  Anyone have any ideas how I can setup constaints on
> NHibernate projections?
>
> Cheers,
> Aeden
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: Rhino Mocks 3.5 Broke Our VS2005 Build

2009-02-24 Thread Ayende Rahien
Probably I didn't clear everything in the config.You can compile the source
directly yourself

On Tue, Feb 24, 2009 at 8:06 PM, Piers  wrote:

>
> I happily upgraded to "Rhino Mocks 3.5 - For .Net 2.0" for use in our
> VS2005 projects. All went well until the change hit the build machine.
> It (on  purpose) does not have the .Net Framework 3.5 installed. The
> automated build failed with:
>
> System.IO.FileNotFoundException The system cannot find the file
> specified.
> File name: 'System.Core, Version=3.5.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089'
>
> Turns out that the Rhino.Mocks.dll included in "Rhino Mocks 3.5 -
> For .Net 2.0" still references the assembly System.Core,
> Version=3.5.0.0. All is fine on a machine with both VS2005 and VS2008,
> but a machine with just VS2005 breaks.
>
> Any workarounds possible?
>
> Piers
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



  1   2   3   4   >