|
| 1 | +namespace AngleSharp.Css.Tests.Declarations |
| 2 | +{ |
| 3 | + using NUnit.Framework; |
| 4 | + using static CssConstructionFunctions; |
| 5 | + |
| 6 | + [TestFixture] |
| 7 | + public class CssResizePropertyTests |
| 8 | + { |
| 9 | + [Test] |
| 10 | + public void CssResizeNoneLegal() |
| 11 | + { |
| 12 | + var snippet = "resize: none"; |
| 13 | + var property = ParseDeclaration(snippet); |
| 14 | + Assert.AreEqual("resize", property.Name); |
| 15 | + Assert.IsFalse(property.IsImportant); |
| 16 | + Assert.IsFalse(property.IsAnimatable); |
| 17 | + Assert.IsFalse(property.IsInherited); |
| 18 | + Assert.IsTrue(property.HasValue); |
| 19 | + Assert.AreEqual("none", property.Value); |
| 20 | + } |
| 21 | + |
| 22 | + [Test] |
| 23 | + public void CssResizeScaledownIllegal() |
| 24 | + { |
| 25 | + var snippet = "resize: scaledown"; |
| 26 | + var property = ParseDeclaration(snippet); |
| 27 | + Assert.AreEqual("resize", property.Name); |
| 28 | + Assert.IsFalse(property.IsImportant); |
| 29 | + Assert.IsFalse(property.IsAnimatable); |
| 30 | + Assert.IsFalse(property.IsInherited); |
| 31 | + Assert.IsFalse(property.HasValue); |
| 32 | + } |
| 33 | + |
| 34 | + [Test] |
| 35 | + public void CssResizeBothLegal() |
| 36 | + { |
| 37 | + var snippet = "resize : both"; |
| 38 | + var property = ParseDeclaration(snippet); |
| 39 | + Assert.AreEqual("resize", property.Name); |
| 40 | + Assert.IsFalse(property.IsImportant); |
| 41 | + Assert.IsFalse(property.IsAnimatable); |
| 42 | + Assert.IsFalse(property.IsInherited); |
| 43 | + Assert.IsTrue(property.HasValue); |
| 44 | + Assert.AreEqual("both", property.Value); |
| 45 | + } |
| 46 | + |
| 47 | + [Test] |
| 48 | + public void CssResizeHorizontalLegal() |
| 49 | + { |
| 50 | + var snippet = "resize : horizontal"; |
| 51 | + var property = ParseDeclaration(snippet); |
| 52 | + Assert.AreEqual("resize", property.Name); |
| 53 | + Assert.IsFalse(property.IsImportant); |
| 54 | + Assert.IsFalse(property.IsAnimatable); |
| 55 | + Assert.IsFalse(property.IsInherited); |
| 56 | + Assert.IsTrue(property.HasValue); |
| 57 | + Assert.AreEqual("horizontal", property.Value); |
| 58 | + } |
| 59 | + |
| 60 | + [Test] |
| 61 | + public void CssResizeVerticalLegal() |
| 62 | + { |
| 63 | + var snippet = "resize : vertical"; |
| 64 | + var property = ParseDeclaration(snippet); |
| 65 | + Assert.AreEqual("resize", property.Name); |
| 66 | + Assert.IsFalse(property.IsImportant); |
| 67 | + Assert.IsFalse(property.IsAnimatable); |
| 68 | + Assert.IsFalse(property.IsInherited); |
| 69 | + Assert.IsTrue(property.HasValue); |
| 70 | + Assert.AreEqual("vertical", property.Value); |
| 71 | + } |
| 72 | + } |
| 73 | +} |
0 commit comments