Hello.

there is a scenario.
I have an app I want to test - I create parameters for the class,
initialize it and trying to test some method like
TryToKnowEveryting().
this is a huge method with several private methods, each of them
trying to validate input params and writing to the static Log.Instance
instance, method WriteEntry(string error, Exception ex, int
errorCategory) for example.

Now the problem - I want to test different input values and check
expecting exceptions. I can do it via
Log.Instance.GetArgumentsForCallsMadeOn(log => log.WriteEntry(null,
null, 0)); and then trying to get internal objects. But this behaviour
is not very good - I want to replace default method with the test one.

I tried this code, but this doesn't work

private List<Exception> _exceptions = new List<Exception>(); - class
field

ILog log = MockRepository.GenerateStub<ILog>();
log.Stub(log2 => (Action<string, Exception, int>)
                                ((error, ex, category) => 
_exceptions.Add(ex))); -
initializing.


Connected question is how can I tell RhinoMock, that in case when
param for method IList<TopActions> DoMyBest(TopUser user) is one
TopUser, it should return one set of values, if another - another. If
it's not one of these two users, it should return third set.

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