public void Tag() { var expected = new TagBuilder("div"); var actual = ExpandShorthand.Do("div").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }
public void TagWithAttribute() { var expected = new TagBuilder("a"); expected.MergeAttribute("href", "#foo"); var actual = ExpandShorthand.Do("a[href='#foo']").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }
public void TagWithHyphenatedClass() { var expected = new TagBuilder("div"); expected.AddCssClass("bar-class"); var actual = ExpandShorthand.Do("div.bar-class").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }
public void TagWithId() { var expected = new TagBuilder("div"); expected.MergeAttribute("id", "MyDiv"); var actual = ExpandShorthand.Do("div#MyDiv").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }
public void TagWithInnerTextWithWhtitespace() { var expected = new TagBuilder("a"); expected.InnerHtml = "Do Stuff"; var actual = ExpandShorthand.Do("a 'Do Stuff'").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }
public void TagWithIdAndMultipleClass() { var expected = new TagBuilder("div"); expected.MergeAttribute("id", "MyDiv"); expected.AddCssClass("barClass"); expected.AddCssClass("fooClass"); var actual = ExpandShorthand.Do("div#MyDiv.fooClass.barClass").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }
public void TagWithInnerTextAndAttributes() { var expected = new TagBuilder("a"); expected.MergeAttribute("href", "#foo"); expected.MergeAttribute("toggle", "things"); expected.InnerHtml = "Do"; var actual = ExpandShorthand.Do("a[href='#foo'][toggle='things'] 'Do'").Item1; Assert.AreEqual(expected.ToString(), actual.Render()); }