public void AddClassToElement_NullOrEmptyClassName_ThrowsArgumentNullException( [Values(null, "")] string className) { Action action = () => Taconite.AddClass(className); action.ShouldThrow <ArgumentNullException>(); }
public void AddClassToElement_NullOrEmptySelector_ThrowsArgumentNullException( [Values(null, "")] string selector) { var className = "class"; Action action = () => Taconite.AddClass(className).To(selector); action.ShouldThrow <ArgumentNullException>(); }
public void AddClassToElement() { var className = "class"; var selector = "#selector"; var result = Taconite.AddClass(className).To(selector); result.Commands.Should().HaveCount(1); var command = result.Commands.Single(); command.As <NonElementCommand>() .Should().NotBeNull() .And.ShouldHave().SharedProperties().EqualTo(new { Command = "addClass", Selector = selector }); command.As <NonElementCommand>().Arguments.Should().HaveCount(1) .And.Contain(className); }
public TaconiteResult AddClass() { return(Taconite.AddClass("green").To("#addClassTarget .example-block")); }