|
1 |
| -namespace AngleSharp.Css.Tests.Declarations |
| 1 | +namespace AngleSharp.Css.Tests.Declarations |
2 | 2 | {
|
3 | 3 | using NUnit.Framework;
|
4 | 4 | using static CssConstructionFunctions;
|
@@ -125,14 +125,15 @@ public void CssListStyleTypeDecimalLeadingZeroLegal()
|
125 | 125 | }
|
126 | 126 |
|
127 | 127 | [Test]
|
128 |
| - public void CssListStyleTypeNumberIllegal() |
| 128 | + public void CssListStyleTypeSomeValueLegal() |
129 | 129 | {
|
130 | 130 | var snippet = "list-style-type: number ";
|
131 | 131 | var property = ParseDeclaration(snippet);
|
132 | 132 | Assert.AreEqual("list-style-type", property.Name);
|
133 | 133 | Assert.IsFalse(property.IsImportant);
|
134 |
| - Assert.IsTrue(property.IsInherited); |
135 |
| - Assert.IsFalse(property.HasValue); |
| 134 | + Assert.IsFalse(property.IsInherited); |
| 135 | + Assert.IsTrue(property.HasValue); |
| 136 | + Assert.AreEqual("number", property.Value); |
136 | 137 | }
|
137 | 138 |
|
138 | 139 | [Test]
|
@@ -277,5 +278,94 @@ public void CssCounterIncrementLegal()
|
277 | 278 | Assert.IsTrue(property.HasValue);
|
278 | 279 | Assert.AreEqual("chapter 1 section 2 page 1", property.Value);
|
279 | 280 | }
|
| 281 | + |
| 282 | + [Test] |
| 283 | + public void CssListStyleStringValue_Issue152() |
| 284 | + { |
| 285 | + var snippet = "list-style-type: \"-\""; |
| 286 | + var property = ParseDeclaration(snippet); |
| 287 | + Assert.AreEqual("list-style-type", property.Name); |
| 288 | + Assert.IsTrue(property.HasValue); |
| 289 | + Assert.AreEqual("\"-\"", property.Value); |
| 290 | + } |
| 291 | + |
| 292 | + [Test] |
| 293 | + public void CssListStyleKannada_Issue152() |
| 294 | + { |
| 295 | + var snippet = "list-style-type: kannada"; |
| 296 | + var property = ParseDeclaration(snippet); |
| 297 | + Assert.AreEqual("list-style-type", property.Name); |
| 298 | + Assert.IsTrue(property.HasValue); |
| 299 | + Assert.AreEqual("kannada", property.Value); |
| 300 | + } |
| 301 | + |
| 302 | + [Test] |
| 303 | + public void CssListStyleTradChineseInformal_Issue152() |
| 304 | + { |
| 305 | + var snippet = "list-style-type: trad-chinese-informal;"; |
| 306 | + var property = ParseDeclaration(snippet); |
| 307 | + Assert.AreEqual("list-style-type", property.Name); |
| 308 | + Assert.IsTrue(property.HasValue); |
| 309 | + Assert.AreEqual("trad-chinese-informal", property.Value); |
| 310 | + } |
| 311 | + |
| 312 | + [Test] |
| 313 | + public void CssListStyleGeorgian_Issue152() |
| 314 | + { |
| 315 | + var snippet = "list-style-type: georgian"; |
| 316 | + var property = ParseDeclaration(snippet); |
| 317 | + Assert.AreEqual("list-style-type", property.Name); |
| 318 | + Assert.IsTrue(property.HasValue); |
| 319 | + Assert.AreEqual("georgian", property.Value); |
| 320 | + } |
| 321 | + |
| 322 | + [Test] |
| 323 | + public void CssListStyleDecimal_Issue152() |
| 324 | + { |
| 325 | + var snippet = "list-style-type: decimal"; |
| 326 | + var property = ParseDeclaration(snippet); |
| 327 | + Assert.AreEqual("list-style-type", property.Name); |
| 328 | + Assert.IsTrue(property.HasValue); |
| 329 | + Assert.AreEqual("decimal", property.Value); |
| 330 | + } |
| 331 | + |
| 332 | + [Test] |
| 333 | + public void CssListStyleSquare_Issue152() |
| 334 | + { |
| 335 | + var snippet = "list-style-type: square"; |
| 336 | + var property = ParseDeclaration(snippet); |
| 337 | + Assert.AreEqual("list-style-type", property.Name); |
| 338 | + Assert.IsTrue(property.HasValue); |
| 339 | + Assert.AreEqual("square", property.Value); |
| 340 | + } |
| 341 | + |
| 342 | + [Test] |
| 343 | + public void CssListStyleCircle_Issue152() |
| 344 | + { |
| 345 | + var snippet = "list-style-type: circle"; |
| 346 | + var property = ParseDeclaration(snippet); |
| 347 | + Assert.AreEqual("list-style-type", property.Name); |
| 348 | + Assert.IsTrue(property.HasValue); |
| 349 | + Assert.AreEqual("circle", property.Value); |
| 350 | + } |
| 351 | + |
| 352 | + [Test] |
| 353 | + public void CssListStyleSymbolsFunction_Issue152() |
| 354 | + { |
| 355 | + var snippet = "list-style-type: symbols(cyclic \"*\" \"†\" \"‡\")"; |
| 356 | + var property = ParseDeclaration(snippet); |
| 357 | + Assert.AreEqual("list-style-type", property.Name); |
| 358 | + Assert.IsTrue(property.HasValue); |
| 359 | + Assert.AreEqual("symbols(cyclic \"*\" \"†\" \"‡\")", property.Value); |
| 360 | + } |
| 361 | + |
| 362 | + [Test] |
| 363 | + public void CssListStyleSymbolsFailingForWrongType_Issue152() |
| 364 | + { |
| 365 | + var snippet = "list-style-type: symbols(foo \"*\" \"†\" \"‡\")"; |
| 366 | + var property = ParseDeclaration(snippet); |
| 367 | + Assert.AreEqual("list-style-type", property.Name); |
| 368 | + Assert.IsFalse(property.HasValue); |
| 369 | + } |
280 | 370 | }
|
281 | 371 | }
|
0 commit comments