|
| 1 | +namespace AngleSharp.Css.Tests.Declarations |
| 2 | +{ |
| 3 | + using NUnit.Framework; |
| 4 | + using static CssConstructionFunctions; |
| 5 | + |
| 6 | + [TestFixture] |
| 7 | + public class CssWidthPropertyTests |
| 8 | + { |
| 9 | + [Test] |
| 10 | + public void CssWidthPropertyAutoLegal() |
| 11 | + { |
| 12 | + var snippet = "width: auto"; |
| 13 | + var property = ParseDeclaration(snippet); |
| 14 | + Assert.AreEqual("width", property.Name); |
| 15 | + Assert.IsFalse(property.IsImportant); |
| 16 | + Assert.IsFalse(property.IsInherited); |
| 17 | + Assert.IsTrue(property.HasValue); |
| 18 | + Assert.AreEqual("auto", property.Value); |
| 19 | + } |
| 20 | + |
| 21 | + [Test] |
| 22 | + public void CssWidthPropertyFitContentLegal() |
| 23 | + { |
| 24 | + var snippet = "width: fit-content"; |
| 25 | + var property = ParseDeclaration(snippet); |
| 26 | + Assert.AreEqual("width", property.Name); |
| 27 | + Assert.IsFalse(property.IsImportant); |
| 28 | + Assert.IsFalse(property.IsInherited); |
| 29 | + Assert.IsTrue(property.HasValue); |
| 30 | + Assert.AreEqual("fit-content", property.Value); |
| 31 | + } |
| 32 | + |
| 33 | + [Test] |
| 34 | + public void CssWidthPropertyValueInPxLegal() |
| 35 | + { |
| 36 | + var snippet = "width: 42px"; |
| 37 | + var property = ParseDeclaration(snippet); |
| 38 | + Assert.AreEqual("width", property.Name); |
| 39 | + Assert.IsFalse(property.IsImportant); |
| 40 | + Assert.IsFalse(property.IsInherited); |
| 41 | + Assert.IsTrue(property.HasValue); |
| 42 | + Assert.AreEqual("42px", property.Value); |
| 43 | + } |
| 44 | + } |
| 45 | +} |
0 commit comments