Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Mocking Private Methods

$
0
0

Figured it out.  Had to use the Mock.NonPublic.Wrap function as mentioned here.

http://www.telerik.com/help/justmock/advanced-usage-mocking-non-public-members-and-types.html

ultimately, this code snippet worked.

dynamic mockedClassWrap = Mock.NonPublic.Wrap(mockedClass);
Mock.NonPublic.Arrange<IEnumerable<OtherPhoneDto>>(mockedClassWrap .GetOtherPhonesByOfficeID(ArgExpr.IsAny<Guid>())).Returns(otherPhoneDtoCollection_AM);

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>