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
When I run the test called MockTheFactoryWithReturnValue (in ReflectiveMocksTest1_Basic) I get a Null Reference exception. It works when I run the entire Test1_Basic set, but when I run it by itself I get the exception.
asked by Amit (600 points)

1 Answer

0 votes
Hi Amit,
Thanks for reporting this.

Change the mock line to call original constructor:
Mock factoryMock = MockManager.Mock(typeof(ProductFactory),Constructor.NotMocked);

This will initialize the _productTable field.

This will be fixed in our next release
answered by scott (32k points)
...