So im actually trying to make a certain method return a different value 
depending on the string parameter that it sends. I saw that you can use 
Repeat.Once() to do what i'm looking for. But, i get an "Previous method 
'IConfigurationManager.get_AppSettings();' requires a return value or an 
exception to throw" even though the previous method returns a string 
already.
Here is my code

_anomalieManager = MockRepository.GenerateMock<IAnomalieManager>();
            _configurationManager = 
MockRepository.GenerateMock<IConfigurationManager>();
            _itineraireManager = 
MockRepository.GenerateMock<IItineraireManager>();
            manager = new SynchroManager(_anomalieManager, 
_configurationManager, _itineraireManager);


_configurationManager.Stub(p => p.AppSettings.Get(Arg<string>.Matches(i => 
i == "CrewCodes"))).Return("Charles").Repeat.Once();
_configurationManager.Stub(a => a.AppSettings.Get(Arg<string>.Matches(s => 
s == "NbJoursAvantAnomalie"))).Return("1").Repeat.Once();
It Crashes at the second line.

Any help would be appreciated thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rhinomocks+unsubscr...@googlegroups.com.
To post to this group, send email to rhinomocks@googlegroups.com.
Visit this group at https://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/d/optout.

Reply via email to