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
0 votes
Hi,
I have a old type mock code in which they are creating the mockobject of an abstract class but an exception is thrown in the latest version.

I tryed to make the Strict to false but still the exception is thrown because of the mocking an abstract class.

Is there a way to avoid the exception.Please help!
asked by yagnyasridhar@yahoo. (600 points)

1 Answer

0 votes
Hi,

First I suggest that if you have the latest version than try to use the new Arrange Act Assert API.


To fake an interface in the AAA API you simply write
IFoo fakeFoo = Isolate.Fake.Instance<IFoo>();


If for some reason it is not possible please post here the test code and the exception that was thrown and I'll try to help you out.
answered by ohad (35.4k points)
...