Anyone?
Nobody use AAA syntax or what?
Please help
On Sep 24, 12:09 pm, Tarpan <[email protected]> wrote:
> I saw the discussion on the stackoverflow.com and tried it. Still,
> Repeat does not work in AssertWasCalled().
>
> DPRepository.AssertWasCalled(Function(DPR) Check_Add(DPR), Function
> (options) options.IgnoreArguments.Repeat.Once)
>
> Is it because of "IgnoreArguments"?
>
> Or because the functionality I check is a SUB not a function? So to
> use it is AssertWasCalled I had to do :
>
> Private Function Check_Add(ByVal repository As
> IDataProviderRepository) As Object
> repository.AddDataProvider(Nothing)
> Return Nothing
> End Function
>
> Really I want to check that "AddDataProvider" was called specific
> number of times.
>
> On Sep 18, 4:12 am, Stefan Steinegger <[email protected]>
> wrote:
>
> > Repeat is an ongoing topic on Rhino, because it does not behave as
> > expected, but this is by specification.
>
> > There is an explanation on
> > stackoverflow:http://stackoverflow.com/questions/887245/rhino-mocks-repeat-once-not...
>
> > by the way: why do you call Expect AND AssertWasCalled? Usually you
> > call
> > - Exect and later VerfiyAllExpectations
> > - OR Stub (if needed) and later AssertWasCalled
>
> > On 16 Sep., 21:14, Tarpan <[email protected]> wrote:
>
> > > Hi,
>
> > > Does anybody know, is there any fix or workaround for "Repeat.Times
> > > (x)" not working with AAA syntax in 3.5?
>
> > > Code (sorry for VB code - employer requirement):
> > > ---------------
> > > <Test()> _
> > > Public Sub DataProviderLoader_Test1()
> > > DPRepository.Expect(Function(DPR) Check_Add
> > > (DPR)).IgnoreArguments.Repeat.Once()
> > > DataProviderLoader.CreateDataProviders(DataDictionary,
> > > DPRepository, SqlRunner)
> > > DPRepository.AssertWasCalled(Function(DPR) Check_Add(DPR),
> > > Function(options) options.IgnoreArguments.Repeat.Once)
> > > End Sub
> > > ---------------
>
> > > 1st Line - DPRepository.Expect() - set expectation to be called just
> > > once
> > > 3rd Line - DPRepository.AssertWasCalled() - verifies that the sub was
> > > called just once
>
> > > The sub called twice (guaranteed) and test completes just fine!
>
> > > Thanks for responses
> > > Tarpan
>
> > > PS. I can not figure out how to use "Repeat" in 3.6. Can anybody show
> > > me an example?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---