Events and Func<bool>

56 views
Skip to first unread message

Sven Arvid

unread,
Feb 13, 2012, 2:15:11 AM2/13/12
to NSubstitute
Hi,

I have a Func<bool> ValidateRow set up that is being raised from a
test with
m_view.ValidateRow += Raise.Event<Func<bool>>();

And after this event is raised I would like to know the return value
from this call, but how do I accomplish that? It is not possible to to
something like
int returnValue = m_view.ValidateRow += Raise.Event<Func<bool>>();

Is there some method that I can call that i've missed or am I using
Raise.Event in a wrong way?

David Tchepak

unread,
Feb 13, 2012, 6:07:17 AM2/13/12
to nsubs...@googlegroups.com
Hi Sven,

Can you give me a little more context about what you are testing? Is m_view a substitute, and you are testing the subscribers to the event? 
In your real m_view code are you using GetInvocationList() to get the return values from subscribers? 

Regards,
David


--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To post to this group, send email to nsubs...@googlegroups.com.
To unsubscribe from this group, send email to nsubstitute...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nsubstitute?hl=en.


Reply all
Reply to author
Forward
0 new messages