Gary,

Glad i could help, can you confirm this works now?

Also you could try, if you want to be more explicit (for your second arg)

Arg<object[]>.List.Element(0, Is.EqualTo(0))

Tim

On Tue, Feb 10, 2009 at 3:03 PM, gbrunton <[email protected]> wrote:

>
> Thanks Tim for you quick response.
>
> I believe this is what I want:
>
> interface.AssertWasCalled(x => x.AddNote(Arg<string>.Is.Anything,
> Arg<object[]>.List.IsIn(0)));
>
> Thank you for your help.  I should have got that myself.  I thought
> about it a while ago and for some reason I got shifted in the wrong
> direction.
>
> Gary
>
>
>
> On Feb 10, 1:44 pm, Tim Barcz <[email protected]> wrote:
> > As always, please report back your findings....
> >
> > Tim
> >
> > On Tue, Feb 10, 2009 at 2:42 PM, Tim Barcz <[email protected]> wrote:
> > > I believe this is failing because you're saying make sure the second
> > > parameter isn't equal to 0 but rather an array with "0" as the 1st
> element.
> >
> > > I cannot test right now, but change the second call, to Is.Anything and
> get
> > > more precise after you confirm that works.  Remember you're not passing
> an
> > > int there but an object array.
> >
> > > Tim
> >
> > > On Tue, Feb 10, 2009 at 2:39 PM, gbrunton <[email protected]> wrote:
> >
> > >> I cannot get the following test/setup to pass.
> >
> > >> public interface Interface
> > >> {
> > >>  void AddNote(string note, params object[] parameters);
> > >> }
> >
> > >> public void MethodUnderTest(Interface interface)
> > >> {
> > >>  interface.AddNote("{0}", 0);
> > >> }
> >
> > >> [Test]
> > >> public void TestingMethodUnderTest()
> > >> {
> > >>  Interface interface = MockRepository.GenerateMock<Interface>();
> >
> > >>  this.CreateSUT().MethodUnderTest(interface);
> >
> > >>  interface.AssertWasCalled(x => x.AddNote(Arg<string>.Is.Anything,
> > >> Arg<object>.Is.Equal(0)));
> > >> }
> >
> > >> I keep getting the following failure message:
> > >> Rhino.Mocks.Exceptions.ExpectationViolationException:
> Interface.AddNote
> > >> (anything, equal to 0); Expected #1, Actual #0.
> >
> > >> Any thoughts?
> >
> > >> Thanks Gary
> >
>

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

Reply via email to