From: Jeff R. <jef...@us...> - 2005-11-20 20:42:33
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorCss/SharpVectors/Dom/Css Modified Files: CssCollectedStyleDeclaration.cs CssPrimitiveAngleValue.cs CssPrimitiveLengthValue.cs CssPrimitiveRgbValue.cs CssStyleDeclaration.cs CssTests.cs CssValue.cs CssXmlElement.cs InheritanceTests.cs Rect.cs RgbColor.cs XPathSelector.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: InheritanceTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/InheritanceTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- InheritanceTests.cs 28 Jun 2003 21:50:04 -0000 1.1 +++ InheritanceTests.cs 20 Nov 2005 20:42:23 -0000 1.2 @@ -36,30 +36,30 @@ public void TestNoInherit() { CssStyleDeclaration csd = getStyles("<a />", "a{foo:bar;runar:'carola';}", "a"); - Assertion.AssertEquals("bar", csd.GetPropertyValue("foo")); - Assertion.AssertEquals("\"carola\"", csd.GetPropertyValue("runar")); + Assert.AreEqual("bar", csd.GetPropertyValue("foo")); + Assert.AreEqual("\"carola\"", csd.GetPropertyValue("runar")); } [Test] public void TestSimple() { CssStyleDeclaration csd = getStyles("<a />", "root{inher:12px} a{not:bar;}", "a"); - Assertion.AssertEquals("bar", csd.GetPropertyValue("not")); - Assertion.AssertEquals("12px", csd.GetPropertyValue("inher")); + Assert.AreEqual("bar", csd.GetPropertyValue("not")); + Assert.AreEqual("12px", csd.GetPropertyValue("inher")); } [Test] public void TestNonInherit() { CssStyleDeclaration csd = getStyles("<a />", "root{not:12px} a{}", "a"); - Assertion.AssertEquals("init", csd.GetPropertyValue("not")); + Assert.AreEqual("init", csd.GetPropertyValue("not")); } [Test] public void TestInheritUnknown() { CssStyleDeclaration csd = getStyles("<a />", "", "a"); - Assertion.AssertEquals(null, csd.GetPropertyCssValue("dummy")); + Assert.AreEqual(null, csd.GetPropertyCssValue("dummy")); } [Test] @@ -67,7 +67,7 @@ { CssStyleDeclaration csd = getStyles("<a />", "root{font-size:18px} a{inher:3em}", "a"); CssPrimitiveValue primValue = csd.GetPropertyCssValue("inher") as CssPrimitiveValue; - Assertion.AssertEquals(54, primValue.GetFloatValue(CssPrimitiveType.Px)); + Assert.AreEqual(54, primValue.GetFloatValue(CssPrimitiveType.Px)); } } } Index: CssTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/CssTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CssTests.cs 23 Oct 2005 23:39:29 -0000 1.2 +++ CssTests.cs 20 Nov 2005 20:42:22 -0000 1.3 @@ -39,37 +39,37 @@ [Test] public void TestStylesheets() { - Assertion.AssertEquals("Number of stylesheets", 2, doc.StyleSheets.Length); + Assert.AreEqual(2, doc.StyleSheets.Length, "Number of stylesheets"); } [Test] public void TestCssStyleSheet() { - Assertion.Assert(doc.StyleSheets[0] is CssStyleSheet); + Assert.IsTrue(doc.StyleSheets[0] is CssStyleSheet); cssStyleSheet = (CssStyleSheet)doc.StyleSheets[0]; - Assertion.Assert("AbsoluteHref", cssStyleSheet.AbsoluteHref.AbsolutePath.EndsWith("css_unittest_01.css")); - Assertion.AssertEquals("Title", cssStyleSheet.Title, "Test title"); - Assertion.AssertEquals("text/css", cssStyleSheet.Type); - Assertion.AssertEquals(false, cssStyleSheet.Disabled); + Assert.IsTrue(cssStyleSheet.AbsoluteHref.AbsolutePath.EndsWith("css_unittest_01.css"), "AbsoluteHref"); + Assert.AreEqual(cssStyleSheet.Title, "Test title", "Title"); + Assert.AreEqual("text/css", cssStyleSheet.Type); + Assert.AreEqual(false, cssStyleSheet.Disabled); } [Test] public void TestCssRules() { - Assertion.AssertEquals("CssRules.Length", 16, cssStyleSheet.CssRules.Length); - Assertion.Assert(cssStyleSheet.CssRules[0] is CssStyleRule); + Assert.AreEqual(16, cssStyleSheet.CssRules.Length, "CssRules.Length"); + Assert.IsTrue(cssStyleSheet.CssRules[0] is CssStyleRule); } [Test] public void TestCssStyleRule() { rule = (CssStyleRule)cssStyleSheet.CssRules[0]; - Assertion.AssertNull(rule.ParentRule); - Assertion.AssertEquals("g", rule.SelectorText); - Assertion.AssertEquals("g{fill:#123456 !important;opacity:0.5;}", rule.CssText); - Assertion.AssertEquals(CssRuleType.StyleRule, rule.Type); - Assertion.AssertSame(cssStyleSheet, rule.ParentStyleSheet); - Assertion.Assert(rule.Style is CssStyleDeclaration); + Assert.IsNull(rule.ParentRule); + Assert.AreEqual("g", rule.SelectorText); + Assert.AreEqual("g{fill:#123456 !important;opacity:0.5;}", rule.CssText); + Assert.AreEqual(CssRuleType.StyleRule, rule.Type); + Assert.AreSame(cssStyleSheet, rule.ParentStyleSheet); + Assert.IsTrue(rule.Style is CssStyleDeclaration); } [Test] @@ -77,28 +77,28 @@ { rule = (CssStyleRule)cssStyleSheet.CssRules[0]; CssStyleDeclaration csd = (CssStyleDeclaration)rule.Style; - Assertion.AssertEquals("fill:#123456 !important;opacity:0.5;", csd.CssText); - Assertion.AssertEquals(2, csd.Length); - Assertion.AssertSame(rule, csd.ParentRule); - Assertion.AssertEquals("important", csd.GetPropertyPriority("fill")); - Assertion.AssertEquals("0.5", csd.GetPropertyValue("opacity")); - Assertion.AssertEquals("", csd.GetPropertyPriority("opacity")); - Assertion.AssertEquals("#123456", csd.GetPropertyValue("fill")); + Assert.AreEqual("fill:#123456 !important;opacity:0.5;", csd.CssText); + Assert.AreEqual(2, csd.Length); + Assert.AreSame(rule, csd.ParentRule); + Assert.AreEqual("important", csd.GetPropertyPriority("fill")); + Assert.AreEqual("0.5", csd.GetPropertyValue("opacity")); + Assert.AreEqual("", csd.GetPropertyPriority("opacity")); + Assert.AreEqual("#123456", csd.GetPropertyValue("fill")); csd.SetProperty("opacity", "0.8", ""); - Assertion.AssertEquals("0.8", csd.GetPropertyValue("opacity")); - Assertion.AssertEquals("", csd.GetPropertyPriority("opacity")); + Assert.AreEqual("0.8", csd.GetPropertyValue("opacity")); + Assert.AreEqual("", csd.GetPropertyPriority("opacity")); csd.SetProperty("opacity", "0.2", "important"); - Assertion.AssertEquals("0.2", csd.GetPropertyValue("opacity")); - Assertion.AssertEquals("important", csd.GetPropertyPriority("opacity")); + Assert.AreEqual("0.2", csd.GetPropertyValue("opacity")); + Assert.AreEqual("important", csd.GetPropertyPriority("opacity")); - Assertion.AssertEquals("0.2", csd.RemoveProperty("opacity")); - Assertion.AssertEquals(1, csd.Length); + Assert.AreEqual("0.2", csd.RemoveProperty("opacity")); + Assert.AreEqual(1, csd.Length); csd.SetProperty("foo", "bar", ""); - Assertion.AssertEquals("bar", csd.GetPropertyValue("foo")); - Assertion.AssertEquals(2, csd.Length); + Assert.AreEqual("bar", csd.GetPropertyValue("foo")); + Assert.AreEqual(2, csd.Length); // reset values csd.RemoveProperty("foo"); @@ -112,74 +112,74 @@ public void TestColorLongHexValue() { CssValue val = (CssValue)colorRules.GetPropertyCssValue("longhex"); - Assertion.Assert("1", val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue, "1"); CssPrimitiveValue primValue = (CssPrimitiveValue)colorRules.GetPropertyCssValue("longhex"); - Assertion.AssertEquals("2", "rgb(101,67,33)", primValue.CssText); - Assertion.AssertEquals("3", CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals("4", CssPrimitiveType.RgbColor, primValue.PrimitiveType); + Assert.AreEqual("rgb(101,67,33)", primValue.CssText, "2"); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType, "3"); + Assert.AreEqual(CssPrimitiveType.RgbColor, primValue.PrimitiveType, "4"); RgbColor color = (RgbColor)primValue.GetRgbColorValue(); - Assertion.AssertEquals("5", 101, color.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals("6", 67, color.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals("7", 33, color.Blue.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals("8", ColorTranslator.FromHtml("#654321"), color.GdiColor); + Assert.AreEqual(101, color.Red.GetFloatValue(CssPrimitiveType.Number), "5"); + Assert.AreEqual(67, color.Green.GetFloatValue(CssPrimitiveType.Number), "6"); + Assert.AreEqual(33, color.Blue.GetFloatValue(CssPrimitiveType.Number), "7"); + Assert.AreEqual(ColorTranslator.FromHtml("#654321"), color.GdiColor, "8"); } [Test] public void TestColorShortHexValue() { CssPrimitiveValue primValue = (CssPrimitiveValue)colorRules.GetPropertyCssValue("shorthex"); - Assertion.AssertEquals("rgb(17,34,51)", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.RgbColor, primValue.PrimitiveType); + Assert.AreEqual("rgb(17,34,51)", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.RgbColor, primValue.PrimitiveType); RgbColor color = (RgbColor)primValue.GetRgbColorValue(); - Assertion.AssertEquals(17, color.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(34, color.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(51, color.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(17, color.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(34, color.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(51, color.Blue.GetFloatValue(CssPrimitiveType.Number)); } [Test] public void TestColorNameValue() { CssPrimitiveValue primValue = (CssPrimitiveValue)colorRules.GetPropertyCssValue("name"); - Assertion.AssertEquals("rgb(60,179,113)", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.RgbColor, primValue.PrimitiveType); + Assert.AreEqual("rgb(60,179,113)", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.RgbColor, primValue.PrimitiveType); RgbColor color = (RgbColor)primValue.GetRgbColorValue(); - Assertion.AssertEquals(60, color.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(179, color.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(113, color.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(60, color.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(179, color.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(113, color.Blue.GetFloatValue(CssPrimitiveType.Number)); primValue = (CssPrimitiveValue)colorRules.GetPropertyCssValue("grey-name"); color = (RgbColor)primValue.GetRgbColorValue(); - Assertion.AssertEquals(119, color.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(136, color.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(153, color.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(119, color.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(136, color.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(153, color.Blue.GetFloatValue(CssPrimitiveType.Number)); } [Test] public void TestColorRgbAbsValue() { CssPrimitiveValue primValue = (CssPrimitiveValue)colorRules.GetPropertyCssValue("rgbabs"); - Assertion.AssertEquals("rgb(45,78,98)", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.RgbColor, primValue.PrimitiveType); + Assert.AreEqual("rgb(45,78,98)", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.RgbColor, primValue.PrimitiveType); RgbColor color = (RgbColor)primValue.GetRgbColorValue(); - Assertion.AssertEquals(45, color.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(78, color.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(98, color.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(45, color.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(78, color.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(98, color.Blue.GetFloatValue(CssPrimitiveType.Number)); } [Test] public void TestColorRgbPercValue() { CssPrimitiveValue primValue = (CssPrimitiveValue)colorRules.GetPropertyCssValue("rgbperc"); - Assertion.AssertEquals("rgb(59,115,171)", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.RgbColor, primValue.PrimitiveType); + Assert.AreEqual("rgb(59,115,171)", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.RgbColor, primValue.PrimitiveType); RgbColor color = (RgbColor)primValue.GetRgbColorValue(); - Assertion.AssertEquals(0.23*255, color.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(0.45*255, color.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(0.67*255, color.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(0.23*255, color.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(0.45*255, color.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(0.67*255, color.Blue.GetFloatValue(CssPrimitiveType.Number)); } #endregion @@ -189,13 +189,13 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[1]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("string"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("string"); - Assertion.AssertEquals("\"a string\"", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.String, primValue.PrimitiveType); + Assert.AreEqual("\"a string\"", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.String, primValue.PrimitiveType); string str = primValue.GetStringValue(); - Assertion.AssertEquals("a string", str); + Assert.AreEqual("a string", str); } #endregion @@ -205,28 +205,28 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[1]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("rect"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("rect"); - Assertion.AssertEquals("rect(10cm 23px 45px 89px)", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.Rect, primValue.PrimitiveType); + Assert.AreEqual("rect(10cm 23px 45px 89px)", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.Rect, primValue.PrimitiveType); IRect rect = primValue.GetRectValue(); ICssPrimitiveValue rectValue = rect.Top; - Assertion.AssertEquals(100, rectValue.GetFloatValue(CssPrimitiveType.Mm)); - Assertion.AssertEquals(CssPrimitiveType.Cm, rectValue.PrimitiveType); + Assert.AreEqual(100, rectValue.GetFloatValue(CssPrimitiveType.Mm)); + Assert.AreEqual(CssPrimitiveType.Cm, rectValue.PrimitiveType); rectValue = rect.Right; - Assertion.AssertEquals(23, rectValue.GetFloatValue(CssPrimitiveType.Px)); - Assertion.AssertEquals(CssPrimitiveType.Px, rectValue.PrimitiveType); + Assert.AreEqual(23, rectValue.GetFloatValue(CssPrimitiveType.Px)); + Assert.AreEqual(CssPrimitiveType.Px, rectValue.PrimitiveType); rectValue = rect.Bottom; - Assertion.AssertEquals(45, rectValue.GetFloatValue(CssPrimitiveType.Px)); - Assertion.AssertEquals(CssPrimitiveType.Px, rectValue.PrimitiveType); + Assert.AreEqual(45, rectValue.GetFloatValue(CssPrimitiveType.Px)); + Assert.AreEqual(CssPrimitiveType.Px, rectValue.PrimitiveType); rectValue = rect.Left; - Assertion.AssertEquals(89, rectValue.GetFloatValue(CssPrimitiveType.Px)); - Assertion.AssertEquals(CssPrimitiveType.Px, rectValue.PrimitiveType); + Assert.AreEqual(89, rectValue.GetFloatValue(CssPrimitiveType.Px)); + Assert.AreEqual(CssPrimitiveType.Px, rectValue.PrimitiveType); } #endregion @@ -237,13 +237,13 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-px"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-px"); - Assertion.AssertEquals("12px", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.Px, primValue.PrimitiveType); + Assert.AreEqual("12px", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.Px, primValue.PrimitiveType); double res = primValue.GetFloatValue(CssPrimitiveType.Px); - Assertion.AssertEquals(12, res); + Assert.AreEqual(12, res); } [Test] @@ -251,13 +251,13 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-unitless"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-unitless"); - Assertion.AssertEquals("67", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.Number, primValue.PrimitiveType); + Assert.AreEqual("67", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.Number, primValue.PrimitiveType); double res = primValue.GetFloatValue(CssPrimitiveType.Number); - Assertion.AssertEquals(67, res); + Assert.AreEqual(67, res); } [Test] @@ -265,12 +265,12 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-cm"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-cm"); - Assertion.AssertEquals("10cm", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.Cm, primValue.PrimitiveType); - Assertion.AssertEquals(10, primValue.GetFloatValue(CssPrimitiveType.Cm)); + Assert.AreEqual("10cm", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.Cm, primValue.PrimitiveType); + Assert.AreEqual(10, primValue.GetFloatValue(CssPrimitiveType.Cm)); } [Test] @@ -278,12 +278,12 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-mm"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-mm"); - Assertion.AssertEquals("10mm", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.Mm, primValue.PrimitiveType); - Assertion.AssertEquals(10, primValue.GetFloatValue(CssPrimitiveType.Mm)); + Assert.AreEqual("10mm", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.Mm, primValue.PrimitiveType); + Assert.AreEqual(10, primValue.GetFloatValue(CssPrimitiveType.Mm)); } [Test] @@ -291,12 +291,12 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-in"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-in"); - Assertion.AssertEquals("10in", primValue.CssText); - Assertion.AssertEquals(CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals(CssPrimitiveType.In, primValue.PrimitiveType); - Assertion.AssertEquals(10, primValue.GetFloatValue(CssPrimitiveType.In)); + Assert.AreEqual("10in", primValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType); + Assert.AreEqual(CssPrimitiveType.In, primValue.PrimitiveType); + Assert.AreEqual(10, primValue.GetFloatValue(CssPrimitiveType.In)); } [Test] @@ -304,12 +304,12 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-pc"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-pc"); - Assertion.AssertEquals("CssText", "10pc", primValue.CssText); - Assertion.AssertEquals("CssValueType", CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals("PrimitiveType", CssPrimitiveType.Pc, primValue.PrimitiveType); - Assertion.AssertEquals("To PC", 10, primValue.GetFloatValue(CssPrimitiveType.Pc)); + Assert.AreEqual("10pc", primValue.CssText, "CssText"); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType, "CssValueType"); + Assert.AreEqual(CssPrimitiveType.Pc, primValue.PrimitiveType, "PrimitiveType"); + Assert.AreEqual(10, primValue.GetFloatValue(CssPrimitiveType.Pc), "To PC"); } [Test] @@ -317,16 +317,16 @@ { CssStyleDeclaration csd = (CssStyleDeclaration)((CssStyleRule)cssStyleSheet.CssRules[5]).Style; CssValue val = (CssValue)csd.GetPropertyCssValue("float-pt"); - Assertion.Assert(val is CssPrimitiveValue); + Assert.IsTrue(val is CssPrimitiveValue); CssPrimitiveValue primValue = (CssPrimitiveValue)csd.GetPropertyCssValue("float-pt"); - Assertion.AssertEquals("CssText", "10pt", primValue.CssText); - Assertion.AssertEquals("CssValueType", CssValueType.PrimitiveValue, primValue.CssValueType); - Assertion.AssertEquals("PrimitiveType", CssPrimitiveType.Pt, primValue.PrimitiveType); - Assertion.AssertEquals("To PC", 10, primValue.GetFloatValue(CssPrimitiveType.Pt)); - Assertion.AssertEquals("To CM", 10/72D*2.54D, primValue.GetFloatValue(CssPrimitiveType.Cm)); - Assertion.AssertEquals("To MM", 100/72D*2.54D, primValue.GetFloatValue(CssPrimitiveType.Mm)); - Assertion.AssertEquals("To IN", 10/72D, primValue.GetFloatValue(CssPrimitiveType.In)); - Assertion.AssertEquals("To PT", 10/12D, primValue.GetFloatValue(CssPrimitiveType.Pc)); + Assert.AreEqual("10pt", primValue.CssText, "CssText"); + Assert.AreEqual(CssValueType.PrimitiveValue, primValue.CssValueType, "CssValueType"); + Assert.AreEqual(CssPrimitiveType.Pt, primValue.PrimitiveType, "PrimitiveType"); + Assert.AreEqual(10, primValue.GetFloatValue(CssPrimitiveType.Pt), "To PC"); + Assert.AreEqual(10/72D*2.54D, primValue.GetFloatValue(CssPrimitiveType.Cm), "To CM"); + Assert.AreEqual(100/72D*2.54D, primValue.GetFloatValue(CssPrimitiveType.Mm), "To MM"); + Assert.AreEqual(10/72D, primValue.GetFloatValue(CssPrimitiveType.In), "To IN"); + Assert.AreEqual(10/12D, primValue.GetFloatValue(CssPrimitiveType.Pc), "To PT"); } #endregion } Index: CssStyleDeclaration.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/CssStyleDeclaration.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CssStyleDeclaration.cs 28 Jun 2003 20:37:30 -0000 1.9 +++ CssStyleDeclaration.cs 20 Nov 2005 20:42:22 -0000 1.10 @@ -349,7 +349,7 @@ } else { - Assertion.Fail(); + Assert.Fail(); } } @@ -357,30 +357,30 @@ public void TestLength() { CssStyleDeclaration csd = getCSD(); - Assertion.AssertEquals(2, csd.Length); + Assert.AreEqual(2, csd.Length); } [Test] public virtual void TestOrigin() { CssStyleDeclaration csd = getCSD(); - Assertion.AssertEquals(CssStyleSheetType.Author, csd.Origin); + Assert.AreEqual(CssStyleSheetType.Author, csd.Origin); } [Test] public void TestPropertyValue() { CssStyleDeclaration csd = getCSD(); - Assertion.AssertEquals("bar", csd.GetPropertyValue("foo")); - Assertion.AssertEquals("23cm", csd.GetPropertyValue("length")); + Assert.AreEqual("bar", csd.GetPropertyValue("foo")); + Assert.AreEqual("23cm", csd.GetPropertyValue("length")); } [Test] public void TestPriority() { CssStyleDeclaration csd = getCSD(); - Assertion.AssertEquals("", csd.GetPropertyPriority("foo")); - Assertion.AssertEquals("important", csd.GetPropertyPriority("length")); + Assert.AreEqual("", csd.GetPropertyPriority("foo")); + Assert.AreEqual("important", csd.GetPropertyPriority("length")); } [Test] @@ -389,12 +389,12 @@ CssStyleDeclaration csd = getCSD(); CssValue cssValue = (CssValue)csd.GetPropertyCssValue("foo"); - Assertion.AssertEquals("bar", cssValue.CssText); - Assertion.AssertEquals("1", CssValueType.PrimitiveValue, cssValue.CssValueType); + Assert.AreEqual("bar", cssValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, cssValue.CssValueType, "1"); cssValue = (CssValue)csd.GetPropertyCssValue("length"); - Assertion.AssertEquals("23cm", cssValue.CssText); - Assertion.AssertEquals("2", CssValueType.PrimitiveValue, cssValue.CssValueType); + Assert.AreEqual("23cm", cssValue.CssText); + Assert.AreEqual(CssValueType.PrimitiveValue, cssValue.CssValueType, "2"); } [Test] @@ -412,13 +412,13 @@ csd.SetProperty("foo", "newvalue", ""); CssValue cssValue = (CssValue)csd.GetPropertyCssValue("foo"); - Assertion.AssertEquals("newvalue", cssValue.CssText); - Assertion.AssertEquals("", csd.GetPropertyPriority("foo")); + Assert.AreEqual("newvalue", cssValue.CssText); + Assert.AreEqual("", csd.GetPropertyPriority("foo")); csd.SetProperty("foo", "value2", "important"); cssValue = (CssValue)csd.GetPropertyCssValue("foo"); - Assertion.AssertEquals("value2", cssValue.CssText); - Assertion.AssertEquals("important", csd.GetPropertyPriority("foo")); + Assert.AreEqual("value2", cssValue.CssText); + Assert.AreEqual("important", csd.GetPropertyPriority("foo")); } [Test] @@ -433,7 +433,7 @@ } else { - Assertion.Fail(); + Assert.Fail(); } } } Index: Rect.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/Rect.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Rect.cs 28 Jun 2003 20:37:30 -0000 1.7 +++ Rect.cs 20 Nov 2005 20:42:23 -0000 1.8 @@ -115,20 +115,20 @@ rect = new Rect("rect(0 100cm 20% 23em)", false); // test top - Assertion.AssertEquals(CssPrimitiveType.Number, rect.Top.PrimitiveType); - Assertion.AssertEquals(0, rect.Top.GetFloatValue(CssPrimitiveType.Cm)); + Assert.AreEqual(CssPrimitiveType.Number, rect.Top.PrimitiveType); + Assert.AreEqual(0, rect.Top.GetFloatValue(CssPrimitiveType.Cm)); // test right - Assertion.AssertEquals(CssPrimitiveType.Cm, rect.Right.PrimitiveType); - Assertion.AssertEquals(100, rect.Right.GetFloatValue(CssPrimitiveType.Cm)); + Assert.AreEqual(CssPrimitiveType.Cm, rect.Right.PrimitiveType); + Assert.AreEqual(100, rect.Right.GetFloatValue(CssPrimitiveType.Cm)); // test bottom - Assertion.AssertEquals(CssPrimitiveType.Percentage, rect.Bottom.PrimitiveType); - Assertion.AssertEquals(20, rect.Bottom.GetFloatValue(CssPrimitiveType.Percentage)); + Assert.AreEqual(CssPrimitiveType.Percentage, rect.Bottom.PrimitiveType); + Assert.AreEqual(20, rect.Bottom.GetFloatValue(CssPrimitiveType.Percentage)); // test left - Assertion.AssertEquals(CssPrimitiveType.Ems, rect.Left.PrimitiveType); - Assertion.AssertEquals(23, rect.Left.GetFloatValue(CssPrimitiveType.Ems)); + Assert.AreEqual(CssPrimitiveType.Ems, rect.Left.PrimitiveType); + Assert.AreEqual(23, rect.Left.GetFloatValue(CssPrimitiveType.Ems)); } } Index: XPathSelector.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/XPathSelector.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- XPathSelector.cs 19 Nov 2005 03:13:23 -0000 1.7 +++ XPathSelector.cs 20 Nov 2005 20:42:23 -0000 1.8 @@ -579,16 +579,16 @@ [Test] public void TestSpecificity() { - Assertion.AssertEquals("*", 0, new XPathSelector("*").Specificity); - Assertion.AssertEquals("LI", 1, new XPathSelector("LI").Specificity); - Assertion.AssertEquals("ns|LI", 1, new XPathSelector("ns|LI", nsTable).Specificity); - Assertion.AssertEquals("UL LI", 2, new XPathSelector("UL LI").Specificity); - Assertion.AssertEquals("UL OL+LI", 3, new XPathSelector("UL OL+LI").Specificity); - Assertion.AssertEquals("H1 + *[REL=up]", 11, new XPathSelector("H1 + *[REL=up]").Specificity); - Assertion.AssertEquals("UL OL LI.red", 13, new XPathSelector("UL OL LI.red").Specificity); - Assertion.AssertEquals("LI.red.level", 21, new XPathSelector("LI.red.level").Specificity); - Assertion.AssertEquals("#x34y", 100 , new XPathSelector("#x34y").Specificity); - Assertion.AssertEquals("#s12:not(FOO)", 101, new XPathSelector("#s12:not(FOO)").Specificity); + Assert.AreEqual(0, new XPathSelector("*").Specificity, "*"); + Assert.AreEqual(1, new XPathSelector("LI").Specificity, "LI"); + Assert.AreEqual(1, new XPathSelector("ns|LI", nsTable).Specificity, "ns|LI"); + Assert.AreEqual(2, new XPathSelector("UL LI").Specificity, "UL LI"); + Assert.AreEqual(3, new XPathSelector("UL OL+LI").Specificity, "UL OL+LI"); + Assert.AreEqual(11, new XPathSelector("H1 + *[REL=up]").Specificity, "H1 + *[REL=up]"); + Assert.AreEqual(13, new XPathSelector("UL OL LI.red").Specificity, "UL OL LI.red"); + Assert.AreEqual(21, new XPathSelector("LI.red.level").Specificity, "LI.red.level"); + Assert.AreEqual(100 , new XPathSelector("#x34y").Specificity, "#x34y"); + Assert.AreEqual(101, new XPathSelector("#s12:not(FOO)").Specificity, "#s12:not(FOO)"); } @@ -596,18 +596,18 @@ [Test] public void TestUniversalMatching() { - Assertion.Assert(new XPathSelector("*").Matches(a)); - Assertion.Assert(new XPathSelector("*").Matches(b)); + Assert.IsTrue(new XPathSelector("*").Matches(a)); + Assert.IsTrue(new XPathSelector("*").Matches(b)); } [Test] public void TestTypeMatching() { - Assertion.Assert(new XPathSelector("a").Matches(a)); - Assertion.Assert(new XPathSelector("b").Matches(b)); + Assert.IsTrue(new XPathSelector("a").Matches(a)); + Assert.IsTrue(new XPathSelector("b").Matches(b)); - Assertion.Assert(!(new XPathSelector("a").Matches(b))); - Assertion.Assert(!(new XPathSelector("A").Matches(a))); + Assert.IsTrue(!(new XPathSelector("a").Matches(b))); + Assert.IsTrue(!(new XPathSelector("A").Matches(a))); } #endregion @@ -615,37 +615,37 @@ [Test] public void TestDescendantMatching() { - Assertion.Assert("a b", new XPathSelector("a b").Matches(b)); - Assertion.Assert("a c", new XPathSelector("a c").Matches(c)); - Assertion.Assert("b d", new XPathSelector("b d").Matches(d)); - Assertion.Assert("b e", !(new XPathSelector("b e").Matches(e))); - Assertion.Assert("b a", !(new XPathSelector("b a").Matches(a))); + Assert.IsTrue(new XPathSelector("a b").Matches(b), "a b"); + Assert.IsTrue(new XPathSelector("a c").Matches(c), "a c"); + Assert.IsTrue(new XPathSelector("b d").Matches(d), "b d"); + Assert.IsTrue(!(new XPathSelector("b e").Matches(e)), "b e"); + Assert.IsTrue(!(new XPathSelector("b a").Matches(a)), "b a"); } [Test] public void TestChildMatching() { - Assertion.Assert("a>b", new XPathSelector("a>b").Matches(b)); - Assertion.Assert("a >c", !(new XPathSelector("a >c").Matches(c))); - Assertion.Assert("a > d", !(new XPathSelector("a > d").Matches(d))); - Assertion.Assert("b> c", new XPathSelector("b> c").Matches(c)); + Assert.IsTrue(new XPathSelector("a>b").Matches(b), "a>b"); + Assert.IsTrue(!(new XPathSelector("a >c").Matches(c)), "a >c"); + Assert.IsTrue(!(new XPathSelector("a > d").Matches(d)), "a > d"); + Assert.IsTrue(new XPathSelector("b> c").Matches(c), "b> c"); } [Test] public void TestDirectAdjacentMatching() { - Assertion.Assert("b +e", new XPathSelector("b +e").Matches(e)); - Assertion.Assert("e+f", new XPathSelector("e+f").Matches(f)); - Assertion.Assert("b+f", !(new XPathSelector("b+f").Matches(f))); + Assert.IsTrue(new XPathSelector("b +e").Matches(e), "b +e"); + Assert.IsTrue(new XPathSelector("e+f").Matches(f), "e+f"); + Assert.IsTrue(!(new XPathSelector("b+f").Matches(f)), "b+f"); } [Test] public void TestIndirectAdjacentMatching() { - Assertion.Assert("b ~e", new XPathSelector("b ~e").Matches(e)); - Assertion.Assert("e~f", new XPathSelector("e~f").Matches(f)); - Assertion.Assert("b~f", new XPathSelector("b~f").Matches(f)); - Assertion.Assert("f~e", !(new XPathSelector("f~e").Matches(e))); + Assert.IsTrue(new XPathSelector("b ~e").Matches(e), "b ~e"); + Assert.IsTrue(new XPathSelector("e~f").Matches(f), "e~f"); + Assert.IsTrue(new XPathSelector("b~f").Matches(f), "b~f"); + Assert.IsTrue(!(new XPathSelector("f~e").Matches(e)), "f~e"); } #endregion @@ -653,21 +653,21 @@ [Test] public void TestClassMatching() { - Assertion.Assert(".class1", new XPathSelector(".class1").Matches(b)); - Assertion.Assert(".class2", new XPathSelector(".class2").Matches(b)); - Assertion.Assert("b.class3", new XPathSelector("b.class3").Matches(b)); - Assertion.Assert(".class3.class2", new XPathSelector(".class3.class2").Matches(b)); - Assertion.Assert(".class1.class2.class3", new XPathSelector(".class1.class2.class3").Matches(b)); + Assert.IsTrue(new XPathSelector(".class1").Matches(b), ".class1"); + Assert.IsTrue(new XPathSelector(".class2").Matches(b), ".class2"); + Assert.IsTrue(new XPathSelector("b.class3").Matches(b), "b.class3"); + Assert.IsTrue(new XPathSelector(".class3.class2").Matches(b), ".class3.class2"); + Assert.IsTrue(new XPathSelector(".class1.class2.class3").Matches(b), ".class1.class2.class3"); - Assertion.Assert(".class1", !(new XPathSelector(".class1").Matches(c))); - Assertion.Assert(".dummy", !(new XPathSelector(".dummy").Matches(b))); + Assert.IsTrue(!(new XPathSelector(".class1").Matches(c)), ".class1"); + Assert.IsTrue(!(new XPathSelector(".dummy").Matches(b)), ".dummy"); } [Test] public void TestIdMatching() { - Assertion.Assert("#mrC", new XPathSelector("#mrC").Matches(c)); - Assertion.Assert("c#mrC", new XPathSelector("c#mrC").Matches(c)); + Assert.IsTrue(new XPathSelector("#mrC").Matches(c), "#mrC"); + Assert.IsTrue(new XPathSelector("c#mrC").Matches(c), "c#mrC"); } @@ -676,19 +676,19 @@ public void TestIdMatchingNoDtd() { // id on <b> is not defined in the DTD as ID - Assertion.Assert("#mrB", !(new XPathSelector("#mrB").Matches(b))); + Assert.IsTrue(!(new XPathSelector("#mrB").Matches(b)), "#mrB"); } [Test] public void TestNsMatching() { - Assertion.Assert("ns|g", new XPathSelector("ns|g", nsTable).Matches(g)); - Assertion.Assert("*|g", new XPathSelector("*|g", nsTable).Matches(g)); - Assertion.Assert("|a", new XPathSelector("|a", nsTable).Matches(a)); - Assertion.Assert("*|a", new XPathSelector("*|a", nsTable).Matches(a)); + Assert.IsTrue(new XPathSelector("ns|g", nsTable).Matches(g), "ns|g"); + Assert.IsTrue(new XPathSelector("*|g", nsTable).Matches(g), "*|g"); + Assert.IsTrue(new XPathSelector("|a", nsTable).Matches(a), "|a"); + Assert.IsTrue(new XPathSelector("*|a", nsTable).Matches(a), "*|a"); - Assertion.Assert("dummy|g", !(new XPathSelector("dummy|g", nsTable).Matches(g))); - Assertion.Assert("ns|a", !(new XPathSelector("ns|a", nsTable).Matches(a))); + Assert.IsTrue(!(new XPathSelector("dummy|g", nsTable).Matches(g)), "dummy|g"); + Assert.IsTrue(!(new XPathSelector("ns|a", nsTable).Matches(a)), "ns|a"); } #endregion @@ -696,87 +696,87 @@ [Test] public void TestAttributeExistsMatching() { - Assertion.Assert("b[att]", new XPathSelector("b[att]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[att]").Matches(b), "b[att]"); - Assertion.Assert("b[ns|nsatt]", new XPathSelector("b[ns|nsatt]", nsTable).Matches(b)); - Assertion.Assert("b[*|nsatt]", new XPathSelector("b[*|nsatt]", nsTable).Matches(b)); - Assertion.Assert("b[*|att]", new XPathSelector("b[*|att]", nsTable).Matches(b)); - Assertion.Assert("b[|att]", new XPathSelector("b[|att]", nsTable).Matches(b)); + Assert.IsTrue(new XPathSelector("b[ns|nsatt]", nsTable).Matches(b), "b[ns|nsatt]"); + Assert.IsTrue(new XPathSelector("b[*|nsatt]", nsTable).Matches(b), "b[*|nsatt]"); + Assert.IsTrue(new XPathSelector("b[*|att]", nsTable).Matches(b), "b[*|att]"); + Assert.IsTrue(new XPathSelector("b[|att]", nsTable).Matches(b), "b[|att]"); - Assertion.Assert("b[|nsatt]", !(new XPathSelector("b[|nsatt]", nsTable).Matches(b))); - Assertion.Assert("b[nsatt]", !(new XPathSelector("b[nsatt]", nsTable).Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[|nsatt]", nsTable).Matches(b)), "b[|nsatt]"); + Assert.IsTrue(!(new XPathSelector("b[nsatt]", nsTable).Matches(b)), "b[nsatt]"); - Assertion.Assert("b[ att][ class ]", new XPathSelector("b[ att][ class ]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[ att][ class ]").Matches(b), "b[ att][ class ]"); - Assertion.Assert("b[att][dummy]", !(new XPathSelector("b[att][dummy]").Matches(b))); - Assertion.Assert("b[dummy]", !(new XPathSelector("b[dummy]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[att][dummy]").Matches(b)), "b[att][dummy]"); + Assert.IsTrue(!(new XPathSelector("b[dummy]").Matches(b)), "b[dummy]"); } [Test] public void TestAttributeValueMatching() { - Assertion.Assert("b[att=attvalue]", new XPathSelector("b[att=attvalue]").Matches(b)); - Assertion.Assert("b[att= 'attvalue' ]", new XPathSelector("b[att= 'attvalue' ]").Matches(b)); - Assertion.Assert("b[ att =\"attvalue\"]", new XPathSelector("b[ att =\"attvalue\"]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[att=attvalue]").Matches(b), "b[att=attvalue]"); + Assert.IsTrue(new XPathSelector("b[att= 'attvalue' ]").Matches(b), "b[att= 'attvalue' ]"); + Assert.IsTrue(new XPathSelector("b[ att =\"attvalue\"]").Matches(b), "b[ att =\"attvalue\"]"); - Assertion.Assert("b[ns|nsatt='foo']", new XPathSelector("b[ns|nsatt='foo']", nsTable).Matches(b)); - Assertion.Assert("b[*|nsatt=foo]", new XPathSelector("b[*|nsatt=foo]", nsTable).Matches(b)); - Assertion.Assert("b[*|att=attvalue]", new XPathSelector("b[*|att=attvalue]", nsTable).Matches(b)); - Assertion.Assert("b[|att=\"attvalue\"]", new XPathSelector("b[|att=\"attvalue\"]", nsTable).Matches(b)); + Assert.IsTrue(new XPathSelector("b[ns|nsatt='foo']", nsTable).Matches(b), "b[ns|nsatt='foo']"); + Assert.IsTrue(new XPathSelector("b[*|nsatt=foo]", nsTable).Matches(b), "b[*|nsatt=foo]"); + Assert.IsTrue(new XPathSelector("b[*|att=attvalue]", nsTable).Matches(b), "b[*|att=attvalue]"); + Assert.IsTrue(new XPathSelector("b[|att=\"attvalue\"]", nsTable).Matches(b), "b[|att=\"attvalue\"]"); - Assertion.Assert("b[|nsatt=foo]", !(new XPathSelector("b[|nsatt=foo]", nsTable).Matches(b))); - Assertion.Assert("b[nsatt=foo]", !(new XPathSelector("b[nsatt=foo]", nsTable).Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[|nsatt=foo]", nsTable).Matches(b)), "b[|nsatt=foo]"); + Assert.IsTrue(!(new XPathSelector("b[nsatt=foo]", nsTable).Matches(b)), "b[nsatt=foo]"); - Assertion.Assert("b[att=dummy]", !(new XPathSelector("b[att=dummy]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[att=dummy]").Matches(b)), "b[att=dummy]"); } [Test] public void TestAttributeValueSpaceSeparatedMatching() { - Assertion.Assert("b[class~=class2]", new XPathSelector("b[class~=class2]").Matches(b)); - Assertion.Assert("b[class~=class3]", new XPathSelector("b[class~=class3]").Matches(b)); - Assertion.Assert("b[class~=class2][class~=class3]", new XPathSelector("b[class~=class2][class~=class3]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[class~=class2]").Matches(b), "b[class~=class2]"); + Assert.IsTrue(new XPathSelector("b[class~=class3]").Matches(b), "b[class~=class3]"); + Assert.IsTrue(new XPathSelector("b[class~=class2][class~=class3]").Matches(b), "b[class~=class2][class~=class3]"); - Assertion.Assert("b[class~=dummy]", !(new XPathSelector("b[class~=dummy]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[class~=dummy]").Matches(b)), "b[class~=dummy]"); } [Test] public void TestAttributeValueBeginMatching() { - Assertion.Assert("b[att^=attv]", new XPathSelector("b[att^=attv]").Matches(b)); - Assertion.Assert("b[att^=attvalue]", new XPathSelector("b[att^=attvalue]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[att^=attv]").Matches(b), "b[att^=attv]"); + Assert.IsTrue(new XPathSelector("b[att^=attvalue]").Matches(b), "b[att^=attvalue]"); - Assertion.Assert("b[att^=dummy]", !(new XPathSelector("b[att^=dummy]").Matches(b))); - Assertion.Assert("b[att^=ttv]", !(new XPathSelector("b[att^=ttv]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[att^=dummy]").Matches(b)), "b[att^=dummy]"); + Assert.IsTrue(!(new XPathSelector("b[att^=ttv]").Matches(b)), "b[att^=ttv]"); } [Test] public void TestAttributeValueEndMatching() { - Assertion.Assert("b[att$=lue]", new XPathSelector("b[att$=lue]").Matches(b)); - Assertion.Assert("b[att$=attvalue]", new XPathSelector("b[att$=attvalue]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[att$=lue]").Matches(b), "b[att$=lue]"); + Assert.IsTrue(new XPathSelector("b[att$=attvalue]").Matches(b), "b[att$=attvalue]"); - Assertion.Assert("b[att$=dummy]", !(new XPathSelector("b[att$=dummy]").Matches(b))); - Assertion.Assert("b[att$=ttv]", !(new XPathSelector("b[att$=ttv]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[att$=dummy]").Matches(b)), "b[att$=dummy]"); + Assert.IsTrue(!(new XPathSelector("b[att$=ttv]").Matches(b)), "b[att$=ttv]"); } [Test] public void TestAttributeValueSubStringMatching() { - Assertion.Assert("b[att*=lue]", new XPathSelector("b[att*=lue]").Matches(b)); - Assertion.Assert("b[att*=attvalue]", new XPathSelector("b[att*=attvalue]").Matches(b)); - Assertion.Assert("b[att*=attv]", new XPathSelector("b[att*=attv]").Matches(b)); + Assert.IsTrue(new XPathSelector("b[att*=lue]").Matches(b), "b[att*=lue]"); + Assert.IsTrue(new XPathSelector("b[att*=attvalue]").Matches(b), "b[att*=attvalue]"); + Assert.IsTrue(new XPathSelector("b[att*=attv]").Matches(b), "b[att*=attv]"); - Assertion.Assert("b[att*=dummy]", !(new XPathSelector("b[att*=dummy]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b[att*=dummy]").Matches(b)), "b[att*=dummy]"); } [Test] public void TestAttributeValueHyphenMatching() { - Assertion.Assert("[hreflang|=sv]", new XPathSelector("[hreflang|=sv]").Matches(c)); + Assert.IsTrue(new XPathSelector("[hreflang|=sv]").Matches(c), "[hreflang|=sv]"); - Assertion.Assert("[hreflang|=sv]", !(new XPathSelector("[hreflang|=sv]").Matches(b))); + Assert.IsTrue(!(new XPathSelector("[hreflang|=sv]").Matches(b)), "[hreflang|=sv]"); } #endregion @@ -793,60 +793,60 @@ [Test] public void TestLangMatching() { - Assertion.Assert("c:lang(se-SV)", new XPathSelector("c:lang(se-SV)").Matches(c)); - Assertion.Assert("c:lang(se)", new XPathSelector("c:lang(se)").Matches(c)); - Assertion.Assert("d:lang(se)", new XPathSelector("d:lang(se)").Matches(d)); + Assert.IsTrue(new XPathSelector("c:lang(se-SV)").Matches(c), "c:lang(se-SV)"); + Assert.IsTrue(new XPathSelector("c:lang(se)").Matches(c), "c:lang(se)"); + Assert.IsTrue(new XPathSelector("d:lang(se)").Matches(d), "d:lang(se)"); - Assertion.Assert("c:lang(se-FI)", !(new XPathSelector("c:lang(se-FI)").Matches(c))); - Assertion.Assert("c:lang(en)", !(new XPathSelector("c:lang(en)").Matches(c))); + Assert.IsTrue(!(new XPathSelector("c:lang(se-FI)").Matches(c)), "c:lang(se-FI)"); + Assert.IsTrue(!(new XPathSelector("c:lang(en)").Matches(c)), "c:lang(en)"); } [Test] public void TestNotMatching() { - Assertion.Assert("c:not(:root))", new XPathSelector("c:not(:root)").Matches(c)); - Assertion.Assert("a:not(.kalle))", new XPathSelector("a:not(.kalle)").Matches(a)); - Assertion.Assert("*:not(b)", new XPathSelector("*:not(b)").Matches(a)); - Assertion.Assert("*:not(b)", new XPathSelector("*:not(b)").Matches(g)); + Assert.IsTrue(new XPathSelector("c:not(:root)").Matches(c), "c:not(:root))"); + Assert.IsTrue(new XPathSelector("a:not(.kalle)").Matches(a), "a:not(.kalle))"); + Assert.IsTrue(new XPathSelector("*:not(b)").Matches(a), "*:not(b)"); + Assert.IsTrue(new XPathSelector("*:not(b)").Matches(g), "*:not(b)"); - Assertion.Assert("*:not(b)", !(new XPathSelector("*:not(b)").Matches(b))); - Assertion.Assert("a:not(:root))", !(new XPathSelector("a:not(:root)").Matches(a))); + Assert.IsTrue(!(new XPathSelector("*:not(b)").Matches(b)), "*:not(b)"); + Assert.IsTrue(!(new XPathSelector("a:not(:root)").Matches(a)), "a:not(:root))"); } [Test] public void TestRootMatching() { - Assertion.Assert("a:root", new XPathSelector("a:root").Matches(a)); - Assertion.Assert("b:root", !(new XPathSelector("b:root").Matches(b))); + Assert.IsTrue(new XPathSelector("a:root").Matches(a), "a:root"); + Assert.IsTrue(!(new XPathSelector("b:root").Matches(b)), "b:root"); } [Test] public void TestContainsMatching() { - Assertion.Assert("d:contains(some)", new XPathSelector("d:contains(some)").Matches(d)); - Assertion.Assert("d:contains('me te')", new XPathSelector("d:contains('me te')").Matches(d)); - Assertion.Assert("d:contains(\"me text\")", new XPathSelector("d:contains(\"me text\")").Matches(d)); + Assert.IsTrue(new XPathSelector("d:contains(some)").Matches(d), "d:contains(some)"); + Assert.IsTrue(new XPathSelector("d:contains('me te')").Matches(d), "d:contains('me te')"); + Assert.IsTrue(new XPathSelector("d:contains(\"me text\")").Matches(d), "d:contains(\"me text\")"); - Assertion.Assert("d:contains(dummy)", !(new XPathSelector("d:contains(dummy)").Matches(d))); + Assert.IsTrue(!(new XPathSelector("d:contains(dummy)").Matches(d)), "d:contains(dummy)"); } [Test] public void TestOnlyChildMatching() { - Assertion.Assert("c:only-child", new XPathSelector("c:only-child").Matches(c)); - Assertion.Assert("d:only-child", new XPathSelector("d:only-child").Matches(d)); + Assert.IsTrue(new XPathSelector("c:only-child").Matches(c), "c:only-child"); + Assert.IsTrue(new XPathSelector("d:only-child").Matches(d), "d:only-child"); - Assertion.Assert("b:only-child", !(new XPathSelector("b:only-child").Matches(b))); - Assertion.Assert("e:only-child", !(new XPathSelector("e:only-child").Matches(e))); + Assert.IsTrue(!(new XPathSelector("b:only-child").Matches(b)), "b:only-child"); + Assert.IsTrue(!(new XPathSelector("e:only-child").Matches(e)), "e:only-child"); } [Test] public void TestEmptyMatching() { - Assertion.Assert("e:empty", new XPathSelector("e:empty").Matches(e)); + Assert.IsTrue(new XPathSelector("e:empty").Matches(e), "e:empty"); - Assertion.Assert("b:empty", !(new XPathSelector("b:empty").Matches(b))); - Assertion.Assert("d:empty", !(new XPathSelector("d:empty").Matches(d))); + Assert.IsTrue(!(new XPathSelector("b:empty").Matches(b)), "b:empty"); + Assert.IsTrue(!(new XPathSelector("d:empty").Matches(d)), "d:empty"); } #endregion @@ -854,69 +854,69 @@ [Test] public void TestFirstChildMatching() { - Assertion.Assert("b:first-child", new XPathSelector("b:first-child").Matches(b)); - Assertion.Assert("d:first-child", new XPathSelector("d:first-child").Matches(d)); + Assert.IsTrue(new XPathSelector("b:first-child").Matches(b), "b:first-child"); + Assert.IsTrue(new XPathSelector("d:first-child").Matches(d), "d:first-child"); - Assertion.Assert("e:first-child", !(new XPathSelector("e:first-child").Matches(e))); + Assert.IsTrue(!(new XPathSelector("e:first-child").Matches(e)), "e:first-child"); } [Test] public void TestLastChildMatching() { - Assertion.Assert("c:last-child", new XPathSelector("c:last-child").Matches(c)); - Assertion.Assert("d:first-child", new XPathSelector("d:first-child").Matches(d)); + Assert.IsTrue(new XPathSelector("c:last-child").Matches(c), "c:last-child"); + Assert.IsTrue(new XPathSelector("d:first-child").Matches(d), "d:first-child"); - Assertion.Assert("b:last-child", !(new XPathSelector("b:last-child").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b:last-child").Matches(b)), "b:last-child"); } [Test] public void TestNthChildMatching() { - Assertion.Assert("1: *:nth-child(2)", new XPathSelector("*:nth-child(2)").Matches(e)); + Assert.IsTrue(new XPathSelector("*:nth-child(2)").Matches(e), "1: *:nth-child(2)"); - Assertion.Assert("e:nth-child(2n)", new XPathSelector("e:nth-child(2n)").Matches(e)); - Assertion.Assert("e:nth-child(n)", new XPathSelector("e:nth-child(n)").Matches(e)); - Assertion.Assert("e:nth-child(4n- 2)", new XPathSelector("e:nth-child(4n-2)").Matches(e)); - Assertion.Assert("g:nth-child(2n)", new XPathSelector("g:nth-child(2n)").Matches(g)); + Assert.IsTrue(new XPathSelector("e:nth-child(2n)").Matches(e), "e:nth-child(2n)"); + Assert.IsTrue(new XPathSelector("e:nth-child(n)").Matches(e), "e:nth-child(n)"); + Assert.IsTrue(new XPathSelector("e:nth-child(4n-2)").Matches(e), "e:nth-child(4n- 2)"); + Assert.IsTrue(new XPathSelector("g:nth-child(2n)").Matches(g), "g:nth-child(2n)"); - Assertion.Assert("b:nth-child( 0n + 1)", new XPathSelector("b:nth-child(0n + 1)").Matches(b)); - Assertion.Assert("e:nth-child( 0n+1)", !(new XPathSelector("e:nth-child( 0n+1)").Matches(e))); + Assert.IsTrue(new XPathSelector("b:nth-child(0n + 1)").Matches(b), "b:nth-child( 0n + 1)"); + Assert.IsTrue(!(new XPathSelector("e:nth-child( 0n+1)").Matches(e)), "e:nth-child( 0n+1)"); - Assertion.Assert("*:nth-child(-n+2)", new XPathSelector("*:nth-child(-n+2)").Matches(b)); - Assertion.Assert("*:nth-child(-n+2)", new XPathSelector("*:nth-child(-n+2)").Matches(e)); - Assertion.Assert("*:nth-child(-n+2)", !(new XPathSelector("*:nth-child(-n+2)").Matches(f))); - Assertion.Assert("*:nth-child(-n+2)", !(new XPathSelector("*:nth-child(-n+2)").Matches(g))); + Assert.IsTrue(new XPathSelector("*:nth-child(-n+2)").Matches(b), "*:nth-child(-n+2)"); + Assert.IsTrue(new XPathSelector("*:nth-child(-n+2)").Matches(e), "*:nth-child(-n+2)"); + Assert.IsTrue(!(new XPathSelector("*:nth-child(-n+2)").Matches(f)), "*:nth-child(-n+2)"); + Assert.IsTrue(!(new XPathSelector("*:nth-child(-n+2)").Matches(g)), "*:nth-child(-n+2)"); // test of odd and even - Assertion.Assert("e:nth-child(even)", new XPathSelector("e:nth-child(even)").Matches(e)); - Assertion.Assert("b:nth-child(odd)", new XPathSelector("b:nth-child(odd)").Matches(b)); - Assertion.Assert("f:nth-child(odd)", new XPathSelector("f:nth-child(odd)").Matches(f)); - Assertion.Assert("e:nth-child(odd)", !(new XPathSelector("e:nth-child(odd)").Matches(e))); - Assertion.Assert("b:nth-child(even)", !(new XPathSelector("b:nth-child(even)").Matches(b))); + Assert.IsTrue(new XPathSelector("e:nth-child(even)").Matches(e), "e:nth-child(even)"); + Assert.IsTrue(new XPathSelector("b:nth-child(odd)").Matches(b), "b:nth-child(odd)"); + Assert.IsTrue(new XPathSelector("f:nth-child(odd)").Matches(f), "f:nth-child(odd)"); + Assert.IsTrue(!(new XPathSelector("e:nth-child(odd)").Matches(e)), "e:nth-child(odd)"); + Assert.IsTrue(!(new XPathSelector("b:nth-child(even)").Matches(b)), "b:nth-child(even)"); // tests for false positives - Assertion.Assert("b:nth-child(2n)", !(new XPathSelector("b:nth-child(2n)").Matches(b))); - Assertion.Assert("f:nth-child(2n)", !(new XPathSelector("f:nth-child(2n)").Matches(b))); + Assert.IsTrue(!(new XPathSelector("b:nth-child(2n)").Matches(b)), "b:nth-child(2n)"); + Assert.IsTrue(!(new XPathSelector("f:nth-child(2n)").Matches(b)), "f:nth-child(2n)"); } public void TestNthLastChildMatching() { - Assertion.Assert("1: *:nth-last-child(5)", new XPathSelector("*:nth-last-child(5)").Matches(e)); + Assert.IsTrue(new XPathSelector("*:nth-last-child(5)").Matches(e), "1: *:nth-last-child(5)"); - Assertion.Assert("2: *:nth-last-child(-n+2)", new XPathSelector("*:nth-last-child(-n+2)").Matches(g)); - Assertion.Assert("3: *:nth-last-child(-n+2)", new XPathSelector("*:nth-last-child(-n+2)").Matches(f)); - Assertion.Assert("4: *:nth-last-child(-n+2)", !(new XPathSelector("*:nth-last-child(-n+2)").Matches(e))); - Assertion.Assert("5: *:nth-last-child(-n+2)", !(new XPathSelector("*:nth-last-child(-n+2)").Matches(b))); + Assert.IsTrue(new XPathSelector("*:nth-last-child(-n+2)").Matches(g), "2: *:nth-last-child(-n+2)"); + Assert.IsTrue(new XPathSelector("*:nth-last-child(-n+2)").Matches(f), "3: *:nth-last-child(-n+2)"); + Assert.IsTrue(!(new XPathSelector("*:nth-last-child(-n+2)").Matches(e)), "4: *:nth-last-child(-n+2)"); + Assert.IsTrue(!(new XPathSelector("*:nth-last-child(-n+2)").Matches(b)), "5: *:nth-last-child(-n+2)"); - Assertion.Assert("*:nth-last-child( odd)", new XPathSelector("*:nth-last-child(odd)").Matches(g)); - Assertion.Assert("*:nth-last-child(odd)", new XPathSelector("*:nth-last-child(odd)").Matches(e)); - Assertion.Assert("*:nth-last-child(odd )", !(new XPathSelector("*:nth-last-child(odd)").Matches(f))); - Assertion.Assert("*:nth-last-child(odd)", !(new XPathSelector("*:nth-last-child(odd)").Matches(b))); + Assert.IsTrue(new XPathSelector("*:nth-last-child(odd)").Matches(g), "*:nth-last-child( odd)"); + Assert.IsTrue(new XPathSelector("*:nth-last-child(odd)").Matches(e), "*:nth-last-child(odd)"); + Assert.IsTrue(!(new XPathSelector("*:nth-last-child(odd)").Matches(f)), "*:nth-last-child(odd )"); + Assert.IsTrue(!(new XPathSelector("*:nth-last-child(odd)").Matches(b)), "*:nth-last-child(odd)"); - Assertion.Assert("*:nth-last-child(even)", new XPathSelector("*:nth-last-child(even)").Matches(f)); - Assertion.Assert("*:nth-last-child( even)", new XPathSelector("*:nth-last-child(even)").Matches(b)); - Assertion.Assert("*:nth-last-child(even)", !(new XPathSelector("*:nth-last-child(even)").Matches(g))); - Assertion.Assert("*:nth-last-child(even )", !(new XPathSelector("*:nth-last-child(even)").Matches(e))); + Assert.IsTrue(new XPathSelector("*:nth-last-child(even)").Matches(f), "*:nth-last-child(even)"); + Assert.IsTrue(new XPathSelector("*:nth-last-child(even)").Matches(b), "*:nth-last-child( even)"); + Assert.IsTrue(!(new XPathSelector("*:nth-last-child(even)").Matches(g)), "*:nth-last-child(even)"); + Assert.IsTrue(!(new XPathSelector("*:nth-last-child(even)").Matches(e)), "*:nth-last-child(even )"); } #endregion Index: CssPrimitiveRgbValue.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/CssPrimitiveRgbValue.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CssPrimitiveRgbValue.cs 14 Feb 2005 15:27:34 -0000 1.7 +++ CssPrimitiveRgbValue.cs 20 Nov 2005 20:42:22 -0000 1.8 @@ -4,7 +4,6 @@ #if TEST using NUnit.Framework; -using System.Collections; #endif namespace SharpVectors.Dom.Css @@ -284,36 +283,36 @@ { color = new CssPrimitiveRgbValue("rgb( 100 , 123,15)", false); RgbColor rgbColor = (RgbColor)color.GetRgbColorValue(); - Assertion.AssertEquals(100, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(123, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(15, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(100, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(123, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(15, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); } public void TestPercentageRgb() { color = new CssPrimitiveRgbValue("rgb(50%, 12%, 100%)", false); RgbColor rgbColor = (RgbColor)color.GetRgbColorValue(); - Assertion.AssertEquals(255*0.5, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(255*0.12, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(255, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(255*0.5, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(255*0.12, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(255, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); } public void TestHex() { color = new CssPrimitiveRgbValue("#12C2a4 ", false); RgbColor rgbColor = (RgbColor)color.GetRgbColorValue(); - Assertion.AssertEquals(18, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(194, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(164, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(18, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(194, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(164, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); } public void TestShortHex() { color = new CssPrimitiveRgbValue(" #C8f", false); RgbColor rgbColor = (RgbColor)color.GetRgbColorValue(); - Assertion.AssertEquals(204, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(136, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); - Assertion.AssertEquals(255, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(204, rgbColor.Red.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(136, rgbColor.Green.GetFloatValue(CssPrimitiveType.Number)); + Assert.AreEqual(255, rgbColor.Blue.GetFloatValue(CssPrimitiveType.Number)); } public void TestCssNames() @@ -349,9 +348,9 @@ RgbColor rgbColor = (Rgb... [truncated message content] |