This is a migrated thread and some comments may be shown as answers.

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

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 19 Sep 2012, 11:41 AM
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

1 Answer, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 21 Sep 2012, 07:54 PM
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.

Tags
General Discussions
Asked by
Christian
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Share this question
or