public GetUrl ( string virtualDirectory ) : string | ||
virtualDirectory | string | |
return | string |
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(); var htmlText = String.Format("<input Id='btnSave' name='btnSave' value='Save' class='button default' 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_full_path_if_pathUtility_is_configured() { IPathUtility pathUtility = new TestPathUtility(); _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="{0}"'/>", pathUtility.GetUrl("/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(); 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, pathUtility.GetUrl("/Admin.mvc/Test")); _buttonData.ToString().ShouldBeEqualTo(htmlText); }