public void ExecutePlugin_NullOrEmptyPluginName_ThrowsArgumentNullException( [Values(null, "")] string pluginName) { Action action = () => Taconite.ExecutePlugin(pluginName); action.ShouldThrow <ArgumentNullException>(); }
public void ExecutePluginWithPartialViewResult_NullPartialViewResult_ThrowsArgumentNullException() { var plugin = "plugin"; var selector = "#selector"; Action action = () => Taconite.ExecutePlugin(plugin).For(selector).WithContent((PartialViewResult)null); action.ShouldThrow <ArgumentNullException>(); }
public void ExecutePlugin_NullOrEmptyTargetSelector_ThrowsArgumentNullException( [Values(null, "")] string selector) { var plugin = "plugin"; Action action = () => Taconite.ExecutePlugin(plugin).For(selector); action.ShouldThrow <ArgumentNullException>(); }
public void ExecutePluginWithRawHtmlContent_NullHtmlContent_ThrowsArgumentNullException() { var plugin = "plugin"; var selector = "#selector"; Action action = () => Taconite.ExecutePlugin(plugin).For(selector).WithContent((string)null); action.ShouldThrow <ArgumentNullException>(); }
public void ExecutePluginWithNoArguments() { var plugin = "plugin"; var selector = "#selector"; var result = Taconite.ExecutePlugin(plugin).For(selector).WithNoArguments(); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <NonElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = plugin, Selector = selector, }); command.As <NonElementCommand>().Arguments.Should().BeEmpty(); }
public void ExecutePluginWithPartialView_ViewNameAndModelNotSpecified() { var plugin = "plugin"; var selector = "#selector"; var result = Taconite.ExecutePlugin(plugin).For(selector).WithPartialView(); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = plugin, Html = (string)null, Selector = selector }); command.As <ElementCommand>().Partial.Model.Should().BeNull(); command.As <ElementCommand>().Partial.View.Should().BeNull(); }
public void ExecutePluginWithPartialViewResultContent() { var plugin = "plugin"; var selector = "#selector"; var partialViewResult = new PartialViewResult(); var result = Taconite.ExecutePlugin(plugin).For(selector).WithContent(partialViewResult); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = plugin, Html = (string)null, Selector = selector, PartialViewResult = partialViewResult }); }
public void ExecutePluginWithRawHtmlContent() { var plugin = "plugin"; var selector = "#selector"; var html = "<div>Some HTML!</div>"; var result = Taconite.ExecutePlugin(plugin).For(selector).WithContent(html); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <ElementCommand>() .Should().NotBeNull() .ShouldHave().SharedProperties().EqualTo(new { Command = plugin, Html = html, Selector = selector, PartialViewResult = (PartialViewResult)null }); }
public TaconiteResult ExecutePlugin() { return(Taconite.ExecutePlugin("modal").For("#executePluginModal").WithNoArguments()); }