Do I have to call Mock.Initialize<T > for baseclasses too?

2 posts, 0 answers
  1. Christian
    Christian avatar
    3 posts
    Member since:
    Sep 2012

    Posted 19 Sep 2012 Link to this post

    we are having problems running out tests in large testruns.
    In this forum I read, that I have to use the Mock.Initialize<T> Method to init the Object I like to mock, if I had instances of this class in preceding tests.
    Do I have to call this Initialize Method also for the base classes, my object ist derived from?

    Thank you very much
  2. Ricky
    Ricky avatar
    467 posts

    Posted 21 Sep 2012 Link to this post

    Hi Christian,

    Thanks again for bringing up the question. 

    Generally, you should initialize the methods that you are trying to mock. Ideally the initializing method’s declaring type and calling method’s declaring type should be same.


    Kind Regards
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top