MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / TestAttributes

Method TestAttributes

Source/Engine/Tests/TestHtmlParser.cs:49–70  ·  view source on GitHub ↗
(string html)

Source from the content-addressed store, hash-verified

47 }
48
49 [TestCase("b<a size=50>b", ExpectedResult = "size=50")]
50 [TestCase("b<a size=50 len=60>b", ExpectedResult = "size=50,len=60")]
51 [TestCase("b<a size=\"50\">b", ExpectedResult = "size=50")]
52 [TestCase("b<a size=\"5 0\">b", ExpectedResult = "size=5 0")]
53 [TestCase("b<a size=50%>b", ExpectedResult = "size=50%")]
54 [TestCase("b<a size=#FF>b", ExpectedResult = "size=#FF")]
55 [TestCase("b<a=value>b", ExpectedResult = "=value")]
56 public string TestAttributes(string html)
57 {
58 var result = string.Empty;
59 var parser = new HtmlParser(html);
60 while (parser.ParseNext(out var tag))
61 {
62 foreach (var e in tag.Attributes)
63 {
64 if (result.Length != 0)
65 result += ',';
66 result += e.Key + "=" + e.Value;
67 }
68 }
69 return result;
70 }
71
72 [TestCase("b<a>", ExpectedResult = false)]
73 [TestCase("b<a/>", ExpectedResult = true)]

Callers

nothing calls this directly

Calls 1

ParseNextMethod · 0.80

Tested by

no test coverage detected