コード例 #1
0
        public void PrependPartialViewResultContentToElement_NullPartialViewResult_ThrowsArgumentNullException()
        {
            var selector = "#selector";

            Action action = () => Taconite.PrependContent((PartialViewResult)null).To(selector);

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

            Action action = () => Taconite.PrependContent((string)null).To(selector);

            action.ShouldThrow <ArgumentNullException>();
        }
コード例 #3
0
        public void PrependPartialViewResultContentToElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException(
            [Values(null, "")] string selector)
        {
            var partialViewResult = new PartialViewResult();

            Action action = () => Taconite.PrependContent(partialViewResult).To(selector);

            action.ShouldThrow <ArgumentNullException>();
        }
コード例 #4
0
        public void PrependRawHtmlContentToElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException(
            [Values(null, "")] string selector)
        {
            var html = "<div>Some HTML!</div>";

            Action action = () => Taconite.PrependContent(html).To(selector);

            action.ShouldThrow <ArgumentNullException>();
        }
コード例 #5
0
        public void PrependRawHtmlContentToElement()
        {
            var selector = "#selector";
            var html     = "<div>Some HTML!</div>";

            var result = Taconite.PrependContent(html).To(selector);

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

            command.As <ElementCommand>()
            .Should().NotBeNull()
            .ShouldHave().SharedProperties().EqualTo(new
            {
                Command           = "prepend",
                Html              = html,
                PartialViewResult = (PartialViewResult)null,
                Selector          = selector
            });
        }
コード例 #6
0
        public void PrependPartialViewResultContentToElement()
        {
            var partialViewResult = new PartialViewResult();
            var selector          = "#selector";

            var result = Taconite.PrependContent(partialViewResult).To(selector);

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

            command.As <ElementCommand>()
            .Should().NotBeNull()
            .ShouldHave().SharedProperties().EqualTo(new
            {
                Command  = "prepend",
                Html     = (string)null,
                Partial  = partialViewResult,
                Selector = selector
            });
        }