public void ReplaceContentsOfElements_NullOrEmptyTargetSelector_ThrowsArgumentNullException( [Values(null, "")] string selector) { Action action = () => Taconite.ReplaceContentsOf(selector); action.ShouldThrow <ArgumentNullException>(); }
public void ReplaceContentsOfElementsWithPartialViewResultContent_NullPartialViewResult_ThrowsArgumentNullException() { var selector = "#selector"; Action action = () => Taconite.ReplaceContentsOf(selector).WithContent((PartialViewResult)null); action.ShouldThrow <ArgumentNullException>(); }
public void ReplaceContentsOfElementsWithRawHtmlContent_NullHtmlContent_ThrowsArgumentNullException() { var selector = "#selector"; Action action = () => Taconite.ReplaceContentsOf(selector).WithContent((string)null); action.ShouldThrow <ArgumentNullException>(); }
public void ReplaceContentsOfElementsWithPartialView_ViewNameAndModelNotSpecified() { var selector = "#selector"; var result = Taconite.ReplaceContentsOf(selector).WithPartialView(); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = "replaceContent", Html = (string)null, Selector = selector }); command.As <ElementCommand>().Partial.Model.Should().BeNull(); command.As <ElementCommand>().Partial.View.Should().BeNull(); }
public void ReplaceContentsOfElementsWithPartialViewResultContent() { var partialViewResult = new PartialViewResult(); var selector = "#selector"; var result = Taconite.ReplaceContentsOf(selector).WithContent(partialViewResult); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = "replaceContent", Html = (string)null, Partial = partialViewResult, Selector = selector }); }
public void ReplaceContentsOfElementsWithRawHtmlContent() { var selector = "#selector"; var html = "<div>Some HTML!</div>"; var result = Taconite.ReplaceContentsOf(selector).WithContent(html); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = "replaceContent", Html = html, PartialViewResult = (PartialViewResult)null, Selector = selector }); }
public TaconiteResult ReplaceContent() { return(Taconite.ReplaceContentsOf("#replaceContentTarget").WithPartialView("GreenBox")); }