Fake web part controls

25/03/2013 13:46

//our target (instance of tested class) has e. g. this.Controls.Add method...

var controls = new List<Control>();

Isolate.WhenCalled(() => target.Controls).WillReturnCollectionValuesOf(controls);