Esempio n. 1
0
        // construction and disposing

        public CommandTestHelper()
        {
            _httpContext = HttpContextHelper.CreateHttpContext("GET", "default.html", null);
            _httpContext.Response.ContentEncoding = Encoding.UTF8;

            _functionType     = typeof(TestFunction);
            _functionTypeName = TypeUtility.GetPartialAssemblyQualifiedName(_functionType);

            _mocks = new MockRepository();
            _mockWebSecurityAdapter = _mocks.StrictMock <IWebSecurityAdapter>();
            _mockWxeSecurityAdapter = _mocks.StrictMock <IWxeSecurityAdapter>();
            _mockSecurableObject    = _mocks.StrictMock <ISecurableObject>();

            _htmlWriter = new HtmlTextWriterSingleTagMock();
        }
        public virtual void SetUp()
        {
            _currentHttpContext = HttpContextHelper.CreateHttpContext("GET", "default.html", null);
            _currentHttpContext.Response.ContentEncoding = System.Text.Encoding.UTF8;
            HttpContextHelper.SetCurrent(_currentHttpContext);

            _functionType               = typeof(TestFunction);
            _functionTypeName           = TypeUtility.GetPartialAssemblyQualifiedName(_functionType);
            _wxeFunctionParameter1Value = "Value1";
            _wxeFunctionParameters      = "\"Value1\"";

            _toolTip       = "This is a Tool Tip.";
            _href          = "test.html?Param1={0}&Param2={1}";
            _target        = "_blank";
            _postBackEvent = "__doPostBack (\"Target\", \"Args\");";
            _onClick       = "return false;";

            _hrefCommand                    = new NavigationCommand();
            _hrefCommand.Type               = CommandType.Href;
            _hrefCommand.ToolTip            = _toolTip;
            _hrefCommand.HrefCommand.Href   = _href;
            _hrefCommand.HrefCommand.Target = _target;

            _eventCommand         = new NavigationCommand();
            _eventCommand.Type    = CommandType.Event;
            _eventCommand.ToolTip = _toolTip;

            _wxeFunctionCommand         = new NavigationCommand();
            _wxeFunctionCommand.Type    = CommandType.WxeFunction;
            _wxeFunctionCommand.ToolTip = _toolTip;
            _wxeFunctionCommand.WxeFunctionCommand.TypeName   = _functionTypeName;
            _wxeFunctionCommand.WxeFunctionCommand.Parameters = _wxeFunctionParameters;
            _wxeFunctionCommand.WxeFunctionCommand.Target     = _target;

            _noneCommand      = new NavigationCommand();
            _noneCommand.Type = CommandType.None;

            _writer = new HtmlTextWriterSingleTagMock();
        }