Im trying to make a method return a different value when called with 
different parameter. I have read that .Repeat.once() was pretty much the 
only way to do this. But, when i try it, i get "requires a return value or 
an exception to throw" even though my previous method actually work and 
returns a value.

Here is my code

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



 [TestMethod]
        public void SynchronizeFlights_Success()
        {
            _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();
        }



Any help would be appreciated

-- 
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