public void LoadViewState() { var testPageHolder = new TestPageHolder(false, RequestMode.PostBack); _replacer.StateModificationStrategy = _stateModificationStrategy; _replacer.Controls.Add(testPageHolder.NamingContainer); MemberCallerMock.Expect(mock => mock.LoadViewStateRecursive(Arg <ControlReplacer> .Is.Same(_replacer), Arg <Hashtable> .Is.NotNull)); MockRepository.ReplayAll(); _stateModificationStrategy.LoadViewState(_replacer, MemberCallerMock); MemberCallerMock.VerifyAllExpectations(); }
private void EnsureWrappedControl() { if (!_hasLoaded) { _hasLoaded = true; Assertion.IsNotNull(_controlToWrap); _stateModificationStrategy.LoadControlState(this, _memberCaller); _stateModificationStrategy.LoadViewState(this, _memberCaller); _memberCaller.SetControlState(_controlToWrap, ControlState.Constructed); Control controlToWrap = _controlToWrap; _controlToWrap = null; Controls.Add(controlToWrap); } }