public void InsertPartialViewResultContentBeforeElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException( [Values(null, "")] string selector) { var partialViewResult = new PartialViewResult(); Action action = () => Taconite.InsertContent(partialViewResult).Before(selector); action.ShouldThrow <ArgumentNullException>(); }
public void InsertRawHtmlContentBeforeElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException( [Values(null, "")] string selector) { var html = "<div>Some HTML!</div>"; Action action = () => Taconite.InsertContent(html).Before(selector); action.ShouldThrow <ArgumentNullException>(); }
public void InsertPartialViewResultContentBeforeElement() { var partialViewResult = new PartialViewResult(); var selector = "#selector"; var result = Taconite.InsertContent(partialViewResult).Before(selector); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = "before", Html = (string)null, Partial = partialViewResult, Selector = selector }); }
public void InsertRawHtmlContentBeforeElement() { var html = "<div>Some HTML!</div>"; var selector = "#selector"; var result = Taconite.InsertContent(html).Before(selector); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = "before", Html = html, Partial = (PartialViewResult)null, Selector = selector }); }
public void InsertPartialViewResultContent_NullPartialViewResult_ThrowsArgumentNullException() { Action action = () => Taconite.InsertContent((PartialViewResult)null); action.ShouldThrow <ArgumentNullException>(); }
public void InsertRawHtmlContent_NullHtmlContent_ThrowsArgumentNullException() { Action action = () => Taconite.InsertContent((string)null); action.ShouldThrow <ArgumentNullException>(); }