Thanks again for bringing the question. Here what you can do is to mock the constructor first then arrange the StringBuilder
with your custom one. Therefore, you could write the test in the following way :
var foo = Mock.Create<FooInternal>(Constructor.Mocked);
var stringBuilder =
is non-virutal, here you would need to have the profiler enabled. But in your case if you want to mock the following line in the constructor itself:
It is generally not possible, since you then have to pass that builder
instance to the getter as well.
Hope that answers your question.
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>