コード例 #1
0
        public void InsertPartialViewBeforeElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException(
            [Values(null, "")] string selector)
        {
            Action action = () => Taconite.InsertPartialView().Before(selector);

            action.ShouldThrow <ArgumentNullException>();
        }
コード例 #2
0
        public void InsertPartialViewBeforeElement_ViewNameAndModelNotSpecified()
        {
            var selector = "#selector";

            var result = Taconite.InsertPartialView().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,
                Selector = selector
            });
            command.As <ElementCommand>().Partial.Model.Should().BeNull();
            command.As <ElementCommand>().Partial.View.Should().BeNull();
        }
コード例 #3
0
        public void InsertPartialViewAfterElement_ViewNameNotSpecifiedAndModelSpecified()
        {
            var model    = new object();
            var selector = "#selector";

            var result = Taconite.InsertPartialView(model).After(selector);

            result.Commands.Should().HaveCount(1);
            var command = result.Commands.Single();

            command.As <ElementCommand>()
            .Should().NotBeNull()
            .ShouldHave().SharedProperties().EqualTo(new
            {
                Command  = "after",
                Html     = (string)null,
                Selector = selector
            });
            command.As <ElementCommand>().Partial.Model.Should().Be(model);
            command.As <ElementCommand>().Partial.View.Should().BeNull();
        }
コード例 #4
0
 public TaconiteResult InsertBefore()
 {
     return(Taconite.InsertPartialView("GreenBox").Before("#insertBeforeTarget .example-block.blue"));
 }
コード例 #5
0
 public TaconiteResult InsertAfter()
 {
     return(Taconite.InsertPartialView("GreenBox").After("#insertAfterTarget .example-block.blue"));
 }