Mock non-public properties?

2 posts, 0 answers
  1. Ken
    Ken avatar
    3 posts
    Member since:
    Oct 2009

    Posted 06 Sep 2012 Link to this post

    It is possible to mock non-public properties?

    It doesn't appear that Mock.NonPublic permits referencing non-public properties. For example, there appears to be no ArrangeGet or ArrangeSet.
  2. Kaloyan
    Kaloyan avatar
    880 posts

    Posted 10 Sep 2012 Link to this post

    Hi Kenneth,

     Thank you for contacting us.

     Mocking non-public properties in JustMock is doable. To help you achieving this, I`m sending a sample project with a simple test method that shows how to mock a non-public get property.

     However mocking a non-public set property is not practicable in JustMock for now. We have this in mind and we are working on the issue.

     In addition you can check our online help documentation, where mocking many of the non-public properties is explain and shown in examples: 

     Let me know if this answers your question.


    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top