public void Should_return_HTML_code_representing_a_button_with_partial_path_if_pathutility_is_not_configured()
 {
     const IPathUtility pathUtility = null;
     _buttonData = new ButtonData(_buttonType, pathUtility);
     SetAdditionalParameters();
     _buttonData.ToString().ShouldBeEqualTo(_htmlText);
 }
 public void Should_return_HTML_code_representing_a_button_with_partial_path_if_pathutility_is_not_configured()
 {
     const IPathUtility pathUtility = null;
     _buttonData = new ButtonData(_buttonType, pathUtility);
     SetAdditionalParameters();
     var htmlText = String.Format("<input Id='btnLink' name='btnLink' value='Cancel' class='cancel' type='button' onClick='javascript:location.href=&quot;{0}&quot;'/>", "/Test/Action/4/name");
     _buttonData.ToString().ShouldBeEqualTo(htmlText);
 }
 public void Should_return_HTML_code_representing_a_button_with_full_path_if_pathUtility_is_configured()
 {
     IPathUtility pathUtility = new TestPathUtility();
     _buttonData = new ButtonData(_buttonType, pathUtility, ControllerName)
                   {
                       ControllerExtension = ".mvc"
                   };
     SetAdditionalParameters();
     _buttonData.ToString().ShouldBeEqualTo(HtmlText);
 }
 public void Should_return_HTML_code_representing_a_button_with_partial_path_if_pathutility_is_not_configured()
 {
     const IPathUtility pathUtility = null;
     _buttonData = new ButtonData(_buttonType, pathUtility, ControllerName)
                   {
                       ControllerExtension = ".mvc"
                   };
     SetAdditionalParameters();
     var htmlText = String.Format("<input Id='btnSave' name='btnSave' value='Save' class='button default' type='submit' action='{0}' onClick='javascript:return changeFormAction(this)'/>", "/Admin.mvc/Save");
     _buttonData.ToString().ShouldBeEqualTo(htmlText);
 }
            public void Should_return_HTML_code_representing_a_button_with_full_path_if_pathUtility_is_configured()
            {
                IPathUtility pathUtility = new TestPathUtility();
                _buttonData = new ButtonData(_buttonType, pathUtility, ControllerName)
                              {
                                  ControllerExtension = ".mvc"
                              };

                var htmlText = String.Format("<input Id='btnSave' name='btnSave' value='Save' class='button' type='submit' action='{0}' onClick='javascript:return changeFormAction(this)'/>", pathUtility.GetUrl("/Admin.mvc/Save"));
                _buttonData.ToString().ShouldBeEqualTo(htmlText);
            }
 public void Should_return_HTML_code_representing_a_button_with_partial_path_if_pathutility_is_not_configured()
 {
     const IPathUtility pathUtility = null;
     _buttonData = new ButtonData(_buttonType, pathUtility, ControllerName)
                   {
                       ControllerExtension = ".mvc"
                   };
     SetAdditionalParameters();
     var htmlText = String.Format("<input Id='btnDelete' name='btnDelete' value='Text' class='cancel' type='submit' action='{2}' onClick='javascript:return confirmThenChangeFormAction({0}{1}{0}, this)'/>", "\"".EscapeForTagAttribute(), _buttonData.ConfirmMessage, "/Admin.mvc/Test");
     _buttonData.ToString().ShouldBeEqualTo(htmlText);
 }
            public void Should_return_HTML_code_representing_a_button_with_full_path_if_pathUtility_is_configured()
            {
                IPathUtility pathUtility = new TestPathUtility();
                _buttonData = new ButtonData(_buttonType, pathUtility, ControllerName)
                              {
                                  ControllerExtension = ".mvc"
                              };

                var htmlText = String.Format("<input Id='btnDelete' name='btnDelete' value='Delete' class='cancel' type='submit' action='{2}' onClick='javascript:return confirmThenChangeFormAction({0}{1}{0}, this)'/>", "\"".EscapeForTagAttribute(), ButtonData.ButtonType.Delete.ConfirmationMessage, pathUtility.GetUrl("/Admin.mvc/Delete"));
                _buttonData.ToString().ShouldBeEqualTo(htmlText);
            }