Пример #1
0
        public void SetAttributeForElement_NullAttributeValue_ThrowsArgumentNullException()
        {
            var attributeName = "attribute";

            Action action = () => Taconite.SetAttribute(attributeName, null);

            action.ShouldThrow <ArgumentNullException>();
        }
Пример #2
0
        public void SetAttributeForElement_NullOrEmptyAttributeName_ThrowsArgumentNullException(
            [Values(null, "")] string attributeName)
        {
            var attributeValue = 123;

            Action action = () => Taconite.SetAttribute(attributeName, attributeValue);

            action.ShouldThrow <ArgumentNullException>();
        }
Пример #3
0
        public void SetAttributeForElement_NullOrEmptyTargetSelector_ThrowsArgumentNullException(
            [Values(null, "")] string selector)
        {
            var attributeName  = "attribute";
            var attributeValue = 123;

            Action action = () => Taconite.SetAttribute(attributeName, attributeValue).For(selector);

            action.ShouldThrow <ArgumentNullException>();
        }
Пример #4
0
        public void SetAttributeForElement()
        {
            var attributeName  = "attribute";
            var attributeValue = 123;
            var selector       = "#selector";

            var result = Taconite.SetAttribute(attributeName, attributeValue).For(selector);

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

            command.As <NonElementCommand>()
            .Should().NotBeNull()
            .ShouldHave().SharedProperties().EqualTo(new
            {
                Command  = "attr",
                Selector = selector
            });
            command.As <NonElementCommand>().Arguments.Should().ContainInOrder(new[] { attributeName, "123" });
        }
Пример #5
0
 public TaconiteResult SetAttribute()
 {
     return(Taconite.SetAttribute("src", Url.Content("~/Content/Images/meerkat.jpg"))
            .For("#setAttributeImage"));
 }