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
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes

Can I get sample code (in C#.Net) on how to create unit test cases for event handlers and methods that return Void using Isolator?

asked by Swathi (1.2k points)

2 Answers

0 votes
Hi Swathi,

You can verify a void method was called using the Verify API:

Isolate.Verify.WasCalledWithAnyArguments(() => obj.VoidMethod());

You're welcome to take a look at a simple example on our introduction page.

Can you please describe what are you trying to test on the events? We have an API for raising events but I am not sure that this is what you're looking for.

Typemock Support
answered by Elisha (12k points)
0 votes
Hi Swathi.

the installation of Isolator comes with a sample project that contains several working examples.
take a look at them you should find examples for void and events there.
answered by error (6.6k points)