chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
hi the following code passes

using (RecordExpectations expectations = RecorderManager.StartRecording())
                expectations.ExpectAndReturn(XElement.Load(""), null).RepeatAlways();

            new Timer(state => XElement.Load(""), null, 3000, 23000);
asked by tolisss (28.8k points)

3 Answers

0 votes
Hi Tolisss,

There seems to be a bug :(

We will work on fixing this issue for the upcoming version of Isolator and we will notify you when this issue is resolved.
answered by dhelper (11.9k points)
0 votes

Actually as far as I know, specifying a "RepeatAlways" semantically means: expect zero or more calls on the method.
therefore since the only expectation set in this example uses the "RepeatAlways" directive, the verify is expected to pass even if no calls are made.

I might be mistaken though :wink:
answered by error (6.6k points)
0 votes
That's right, I missed the RepeatAlways definition.

Tolisss - I guess you can specify the numbers of times you want this call to happen i.e. use the default and not RepeatAlways to expect only one call.
answered by dhelper (11.9k points)