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
Is there any way to mock an exception when New Object is created? I tried looking for ExpectConstructorAndThrow but no luck.

In my Class To Be Tested,
Dim logon As New Encore.Utilities

In my Unit Test,
Dim EncoreUtilities As Mock = MockManager.MockObject(GetType(Encore.Utilities))
EncoreUtilities.ExpectConstructorAndThrow(New Exception)

Thanks for any help
asked by jimmyseow123 (4.6k points)

1 Answer

0 votes
Is there any way to mock an exception when New Object is created? I tried looking for ExpectConstructorAndThrow but no luck.


Hi,
There is no support for this as yet, it will be added to our feature list.
Thanks for bringing this up
answered by scott (32k points)
...