コード例 #1
0
        public void InsertPartialViewResultContentBeforeElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException(
            [Values(null, "")] string selector)
        {
            var partialViewResult = new PartialViewResult();

            Action action = () => Taconite.InsertContent(partialViewResult).Before(selector);

            action.ShouldThrow <ArgumentNullException>();
        }
コード例 #2
0
        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>();
        }
コード例 #3
0
        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
            });
        }
コード例 #4
0
        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
            });
        }
コード例 #5
0
        public void InsertPartialViewResultContent_NullPartialViewResult_ThrowsArgumentNullException()
        {
            Action action = () => Taconite.InsertContent((PartialViewResult)null);

            action.ShouldThrow <ArgumentNullException>();
        }
コード例 #6
0
        public void InsertRawHtmlContent_NullHtmlContent_ThrowsArgumentNullException()
        {
            Action action = () => Taconite.InsertContent((string)null);

            action.ShouldThrow <ArgumentNullException>();
        }