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

    Hi,
    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
    Christian
  2. Ricky
    Admin
    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
    Mehfuz
    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.

  3. DevCraft R3 2016 release webinar banner
Back to Top