I have this ctor:
public Section()
{
_tabs = new TabCollection(this);
_sections = new SubSectionCollection(this);
}
I would like to get something like this:
public Section()
: this(new TabCollection(this), new SubSectionCollection(this))
{
}
public Section(TabCollection tabCollection, IList<ISection> sections)
{
_tabs = tabCollection;
_sections = sections;
}
Of course this doesn't work. Anyone has any suggestion how I could refactor this code? I need to do this in order to be able to Mock an object of type Section in Unit Testing. We are using FakeItEasy testing framework.