public void LoadControlState()
        {
            var testPageHolder = new TestPageHolder(false, RequestMode.PostBack);

            _replacer.StateModificationStrategy = _stateModificationStrategy;
            _replacer.Controls.Add(testPageHolder.NamingContainer);

            MemberCallerMock.Expect(mock => mock.SetChildControlState(Arg <ControlReplacer> .Is.Same(_replacer), Arg <Hashtable> .Is.NotNull));
            MockRepository.ReplayAll();

            _stateModificationStrategy.LoadControlState(_replacer, MemberCallerMock);

            MockRepository.VerifyAll();
        }
Example #2
0
        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);
            }
        }