You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(41) |
Oct
(14) |
Nov
(62) |
Dec
|
---|
From: Jeff R. <jef...@us...> - 2005-11-21 19:45:00
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21574/src/SharpVectorRenderingEngine Modified Files: SharpVectorRenderingEngine.build Log Message: Updated build scripts for new scripting support Index: SharpVectorRenderingEngine.build =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectorRenderingEngine.build,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SharpVectorRenderingEngine.build 11 Sep 2005 18:25:02 -0000 1.8 +++ SharpVectorRenderingEngine.build 21 Nov 2005 19:44:48 -0000 1.9 @@ -46,7 +46,6 @@ <copy file="..\SharpVectorDom\${build.dir}\SharpVectorDom.dll" todir="${build.dir}" /> <copy file="..\SharpVectorUtil\${build.dir}\SharpVectorUtil.dll" todir="${build.dir}"/> <copy file="..\SharpVectorCss\${build.dir}\SharpVectorCss.dll" todir="${build.dir}"/> - <copy file="..\SharpVectorScripting\${build.dir}\SharpVectorScripting.dll" todir="${build.dir}"/> <copy file="..\SharpVectorObjectModel\${build.dir}\SharpVectorObjectModel.dll" todir="${build.dir}"/> <!-- compile UrbanScience.dll --> @@ -59,7 +58,6 @@ <include name="SharpVectorDom.dll"/> <include name="SharpVectorCss.dll"/> <include name="SharpVectorUtil.dll"/> - <include name="SharpVectorScripting.dll"/> <include name="SharpVectorObjectModel.dll"/> <include name="SharpZipLib"/> </references> |
From: Jeff R. <jef...@us...> - 2005-11-21 19:44:56
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21574 Modified Files: SharpVectors.build Log Message: Updated build scripts for new scripting support Index: SharpVectors.build =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/SharpVectors.build,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- SharpVectors.build 23 Oct 2005 23:39:28 -0000 1.9 +++ SharpVectors.build 21 Nov 2005 19:44:48 -0000 1.10 @@ -22,7 +22,7 @@ <property name="target" value="debug"/> <property name="target.debug" value="true"/> <property name="target.release" value="false"/> - <property name="build.dir" value="bin/net 1.0/debug/multiple"/> + <property name="build.dir" value="bin/net 1.1/debug/multiple"/> <call target="build"/> </target> @@ -35,7 +35,7 @@ <property name="target.release" value="true"/> <property name="target.debug" value="false"/> - <property name="build.dir" value="bin/net 1.0/release/multiple"/> + <property name="build.dir" value="bin/net 1.1/release/multiple"/> <call target="build"/> </target> @@ -44,7 +44,7 @@ <property name="target.release" value="false"/> <property name="target.debug" value="true"/> - <property name="build.dir" value="bin/net 1.0/debug/single"/> + <property name="build.dir" value="bin/net 1.1/debug/single"/> <call target="build-single"/> </target> @@ -53,7 +53,7 @@ <property name="target.release" value="true"/> <property name="target.debug" value="false"/> - <property name="build.dir" value="bin/net 1.0/release/single"/> + <property name="build.dir" value="bin/net 1.1/release/single"/> <call target="build-single"/> </target> @@ -101,9 +101,9 @@ <nant target="${target}" buildfile="src\SharpVectorUtil\SharpVectorUtil.build" /> <nant target="${target}" buildfile="src\SharpVectorDom\SharpVectorDom.build" /> <nant target="${target}" buildfile="src\SharpVectorCss\SharpVectorCss.build" /> - <nant target="${target}" buildfile="src\SharpVectorScripting\SharpVectorScripting.build" /> <nant target="${target}" buildfile="src\SharpVectorObjectModel\SharpVectorObjectModel.build" /> <nant target="${target}" buildfile="src\SharpVectorRenderingEngine\SharpVectorRenderingEngine.build" /> + <nant target="${target}" buildfile="src\SharpVectorScripting\SharpVectorScripting.build" /> <nant target="${target}" buildfile="src\SvgComponents\SvgComponents.build" /> <nant target="${target}" buildfile="src\SharpVectorViewer\SharpVectorViewer.build" /> <nant target="${target}" buildfile="src\SharpVectorUnitTests\SharpVectorUnitTests.build" if="${target.debug}"/> @@ -257,9 +257,9 @@ <include name="SharpVectorBindings.dll"/> <include name="SharpVectorDom.dll"/> <include name="SharpVectorUtil.dll"/> - <include name="SharpVectorScripting.dll"/> <include name="SharpVectorCss.dll"/> <include name="SharpVectorObjectModel.dll"/>--> + <include name="SharpVectorScripting.dll"/> </assemblies> <summaries basedir="."> <include name="namespace-summary.xml"/> |
From: Jeff R. <jef...@us...> - 2005-11-21 19:44:56
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21574/src/SharpVectorObjectModel Modified Files: SharpVectorObjectModel.build Log Message: Updated build scripts for new scripting support Index: SharpVectorObjectModel.build =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectorObjectModel.build,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- SharpVectorObjectModel.build 11 Sep 2005 18:25:02 -0000 1.10 +++ SharpVectorObjectModel.build 21 Nov 2005 19:44:48 -0000 1.11 @@ -50,8 +50,7 @@ <copy file="..\SharpVectorDom\${build.dir}\SharpVectorDom.dll" todir="${build.dir}" /> <copy file="..\SharpVectorUtil\${build.dir}\SharpVectorUtil.dll" todir="${build.dir}"/> <copy file="..\SharpVectorCss\${build.dir}\SharpVectorCss.dll" todir="${build.dir}"/> - <copy file="..\SharpVectorScripting\${build.dir}\SharpVectorScripting.dll" todir="${build.dir}"/> - + <!-- compile SharpVectorObjectModel.dll --> <!-- doc="${build.dir}\${project.name}.xml" --> @@ -66,7 +65,6 @@ <include name="SharpVectorDom.dll"/> <include name="SharpVectorUtil.dll"/> <include name="SharpVectorCss.dll"/> - <include name="SharpVectorScripting.dll"/> </references> <!-- <arg value="/warnaserror"/> |
From: Jeff R. <jef...@us...> - 2005-11-21 19:44:25
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorScripting/SharpVectors/Scripting/Wrapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21493/src/SharpVectorScripting/SharpVectors/Scripting/Wrapping Modified Files: ScriptWrapper.cs Log Message: Updated build scripts for new scripting support Index: ScriptWrapper.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorScripting/SharpVectors/Scripting/Wrapping/ScriptWrapper.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ScriptWrapper.cs 19 Nov 2005 03:15:35 -0000 1.1 +++ ScriptWrapper.cs 21 Nov 2005 19:44:17 -0000 1.2 @@ -105,7 +105,7 @@ /// <summary> /// Removes the wrapper and base object key value pair. This function is called by the ScriptableObject destructor. /// </summary> - /// <param name="baseObject"></param> + /// <param name="wrappableObject">The key object that was wrapped, to be removed.</param> public static void RemoveWrapper(object wrappableObject) { if (wrappableObject == null) |
From: Jeff R. <jef...@us...> - 2005-11-21 19:44:25
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorScripting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21493/src/SharpVectorScripting Modified Files: SharpVectorScripting.build Log Message: Updated build scripts for new scripting support Index: SharpVectorScripting.build =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorScripting/SharpVectorScripting.build,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SharpVectorScripting.build 11 Sep 2005 18:25:02 -0000 1.5 +++ SharpVectorScripting.build 21 Nov 2005 19:44:17 -0000 1.6 @@ -40,15 +40,23 @@ <mkdir dir="${build.dir}"/> <copy file="${lib.dir}\SharpZipLib.dll" todir="${build.dir}"/> <copy file="..\SharpVectorUtil\${build.dir}\SharpVectorUtil.dll" todir="${build.dir}"/> - + <copy file="..\SharpVectorBindings\${build.dir}\SharpVectorBindings.dll" todir="${build.dir}"/> + <copy file="..\SharpVectorCss\${build.dir}\SharpVectorCss.dll" todir="${build.dir}"/> + <copy file="..\SharpVectorDom\${build.dir}\SharpVectorDom.dll" todir="${build.dir}"/> + <copy file="..\SharpVectorObjectModel\${build.dir}\SharpVectorObjectModel.dll" todir="${build.dir}"/> + <!-- compile SharpVectorScripting.dll --> <csc target="library" output="${build.dir}\${project.name}.dll" doc="${build.dir}\${project.name}.xml" debug="${debug}"> <sources basedir="."> <include name="**.cs"/> </sources> <references> - <include name="SharpZipLib.dll"/> - <include name="SharpVectorUtil.dll"/> + <include name="${build.dir}\SharpVectorBindings.dll"/> + <include name="${build.dir}\SharpVectorDom.dll"/> + <include name="${build.dir}\SharpVectorUtil.dll"/> + <include name="${build.dir}\SharpVectorCss.dll"/> + <include name="${build.dir}\SharpVectorObjectModel.dll"/> + <include name="${build.dir}\SharpZipLib"/> <include name="${nant.settings.defaultframework.frameworkassemblydirectory}\Microsoft.JScript.dll"/> <include name="Microsoft.Vsa.dll"/> </references> |
From: Jeff R. <jef...@us...> - 2005-11-21 19:42:23
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorBindings/SharpVectors/Dom/Svg/Rendering In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21149/src/SharpVectorBindings/SharpVectors/Dom/Svg/Rendering Added Files: ISvgRenderer.cs RenderingNode.cs Log Message: Removed from SharpVecotObjectModel and move to SharpVectorBindings --- NEW FILE: RenderingNode.cs --- using System; using System.Drawing; using SharpVectors.Dom.Svg; namespace SharpVectors.Dom.Svg.Rendering { /// <summary> /// Defines the interface required for a rendering node to interact with the renderer and the SVG DOM /// </summary> /// <developer>ke...@ke...</developer> /// <completed>0</completed> public abstract class RenderingNode { #region Fields protected ISvgElement element; #endregion protected RenderingNode(ISvgElement element) { this.element = element; } public ISvgElement Element { get{return element;} } protected RectangleF screenRegion = RectangleF.Empty; public RectangleF ScreenRegion { get { return screenRegion; } set { screenRegion = value; } } public virtual bool NeedRender(ISvgRenderer renderer) { // We make this assumption so that the first pass is still fast // That way we don't have to calculate the screen regions // Before a full rerender if (screenRegion == RectangleF.Empty) return true; if (renderer.InvalidRect == RectangleF.Empty) return true; if (renderer.InvalidRect.IntersectsWith(screenRegion)) // TODO: Eventually add a full path check here? return true; return false; } // define empty handlers by default public virtual void BeforeRender(ISvgRenderer renderer) {} public virtual void Render(ISvgRenderer renderer) {} public virtual void AfterRender(ISvgRenderer renderer) {} } } --- NEW FILE: ISvgRenderer.cs --- using System; using System.Xml; using System.Drawing; using SharpVectors.Dom.Svg; namespace SharpVectors.Dom.Svg.Rendering { public delegate void RenderEvent(RectangleF updatedRect); /// <summary> /// Defines the interface required by a renderer to render the SVG DOM. /// </summary> /// <remarks> /// The <see cref="ISvgRenderer">ISvgRenderer</see> is used to render /// a <see cref="SvgElement">SvgElement</see> object onto a bitmap. /// During the rendering process, it will also generate /// <see cref="RenderingNode">RenderingNode</see> objects for each /// <see cref="XmlElement">XmlElement</see> object in the DOM tree to /// assist in the rendering. /// </remarks> /// <developer>ke...@ke...</developer> /// <completed>0</completed> public interface ISvgRenderer { /// <summary> /// The window that is being rendered to. /// </summary> ISvgWindow Window { get; set; } /// <summary> /// Creates a <see cref="RenderingNode">RenderingNode</see> for /// <c>node</c> so that it may be rendered. /// </summary> /// <param name="node"> /// The <see cref="XmlEleemnt">XmlElement</see> object for which /// the <see cref="RenderingNode">RenderingNode</see> object is /// created. /// </param> /// <returns> /// A new <see cref="RenderingNode">RenderingNode</see> object /// which can be used to render <c>node</c>. /// </returns> RenderingNode GetRenderingNode( ISvgElement node); /// <summary> /// Creates a new <see cref="ISvgRenderer">ISvgRenderer</see> object. /// This method is not used. /// </summary> ISvgRenderer GetRenderer(); /// <summary> /// Renders an <see cref="SvgElement">SvgElement</see> object onto a /// bitmap and returns that bitmap. /// </summary> /// <param name="node"> /// The SvgElement object to be rendered. /// </param> /// <returns> /// A bitmap with <c>node</c> rendered onto it. /// </returns> Bitmap Render( ISvgElement node); /// <summary> /// Renders an <see cref="SvgDocument">SvgDocument</see> object onto /// a bitmap and returns that bitmap. /// </summary> /// <param name="node"> /// The SvgDocument object to be rendered. /// </param> /// <returns> /// A bitmap with <c>node</c> rendered onto it. /// </returns> Bitmap Render( ISvgDocument node); /// <summary> /// Controls the rendering of the document. /// </summary> RectangleF InvalidRect { get; set; } /// <summary> /// Allows you to establish or add to the existing invalidation rectangle /// </summary> /// <param name="rect"></param> void InvalidateRect(RectangleF rect); /// <summary> /// Event Delegate to report when the SVG renderer does it's work. /// </summary> RenderEvent OnRender { get; set; } } } |
From: Jeff R. <jef...@us...> - 2005-11-21 19:41:45
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorBindings/SharpVectors/Dom/Svg/Rendering In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21000/Rendering Log Message: Directory /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorBindings/SharpVectors/Dom/Svg/Rendering added to the repository |
From: Jeff R. <jef...@us...> - 2005-11-21 19:40:44
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Rendering In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20845/src/SharpVectorObjectModel/SharpVectors/dom/svg/Rendering Removed Files: ISvgRenderer.cs RenderingNode.cs Log Message: Remove and move to SharpVectorBindings --- RenderingNode.cs DELETED --- --- ISvgRenderer.cs DELETED --- |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:37
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types Modified Files: SvgAngleTests.cs SvgElementTests.cs SvgLengthListTests.cs SvgLengthTests.cs SvgListTests.cs SvgMatrixTests.cs SvgNumberListTests.cs SvgNumberTests.cs SvgPointListTests.cs SvgPointTests.cs SvgStringListTests.cs SvgTransformListTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgElementTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgElementTests.cs 28 Jun 2003 20:37:31 -0000 1.3 +++ SvgElementTests.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -24,7 +24,7 @@ public override void TestTypeFromDocument() { XmlElement elm = Util.GetXmlElement("<" + localName + " xmlns='http://www.w3.org/2000/svg' />", "", localName); - Assertion.AssertEquals(elmType, elm.GetType()); + Assert.AreEqual(elmType, elm.GetType()); } [Test] @@ -34,70 +34,71 @@ SvgDocument doc = new SvgDocument(wnd); XmlElement elm = doc.CreateElement("", localName, "http://www.w3.org/2000/svg"); - Assertion.AssertEquals(elmType, elm.GetType()); + Assert.AreEqual(elmType, elm.GetType()); } [Test] public void TestId() { SvgElement elm = Util.GetXmlElement("<" + localName + " xmlns='http://www.w3.org/2000/svg' id='kalle' />", "", localName) as SvgElement; - Assertion.AssertEquals("kalle", elm.Id); + Assert.AreEqual("kalle", elm.Id); } [Test] public void TestOwnerDocument() { SvgElement elm = Util.GetXmlElement("<" + localName + " xmlns='http://www.w3.org/2000/svg' />", "", localName) as SvgElement; - Assertion.Assert(elm.OwnerDocument is SvgDocument); + ISvgDocument doc = elm.OwnerDocument as ISvgDocument; + Assert.IsNotNull(doc); } [Test] public void TestOwnerSvgElement() { SvgElement elm = Util.GetXmlElement("<svg id='svgElm' xmlns='http://www.w3.org/2000/svg'><" + localName + " /></svg>", "", localName) as SvgElement; - Assertion.AssertEquals("2", elm.OwnerDocument.SelectSingleNode("//*[@id='svgElm']"), elm.OwnerSvgElement); + Assert.AreEqual(elm.OwnerDocument.SelectSingleNode("//*[@id='svgElm']"), elm.OwnerSvgElement, "2"); } [Test] public void TestViewportElement() { SvgElement elm = Util.GetXmlElement("<svg id='svgElm' xmlns='http://www.w3.org/2000/svg'><" + localName + " /></svg>", "", localName) as SvgElement; - Assertion.AssertEquals(elm.OwnerDocument.SelectSingleNode("//*[@id='svgElm']"), elm.ViewportElement); + Assert.AreEqual(elm.OwnerDocument.SelectSingleNode("//*[@id='svgElm']"), elm.ViewportElement); } [Test] public void TestXmlLang() { SvgElement elm = Util.GetXmlElement("<" + localName + " xmlns='http://www.w3.org/2000/svg' xml:lang='sv-SE' />", "", localName) as SvgElement; - Assertion.AssertEquals("sv-SE", elm.XmlLang); + Assert.AreEqual("sv-SE", elm.XmlLang); } [Test] public void TestInheritedXmlLang() { SvgElement elm = Util.GetXmlElement("<svg id='svgElm' xmlns='http://www.w3.org/2000/svg' xml:lang='sv-SE'><" + localName + " /></svg>", "", localName) as SvgElement; - Assertion.AssertEquals("sv-SE", elm.XmlLang); + Assert.AreEqual("sv-SE", elm.XmlLang); } [Test] public void TestXmlSpace() { SvgElement elm = Util.GetXmlElement("<" + localName + " xmlns='http://www.w3.org/2000/svg' xml:space='default' />", "", localName) as SvgElement; - Assertion.AssertEquals("default", elm.XmlSpace); + Assert.AreEqual("default", elm.XmlSpace); } [Test] public void TestDefaultXmlSpace() { SvgElement elm = Util.GetXmlElement("<" + localName + " xmlns='http://www.w3.org/2000/svg' />", "", localName) as SvgElement; - Assertion.AssertEquals("default", elm.XmlSpace); + Assert.AreEqual("default", elm.XmlSpace); } [Test] public void TestInheritedXmlSpace() { SvgElement elm = Util.GetXmlElement("<svg id='svgElm' xmlns='http://www.w3.org/2000/svg' xml:space='preserve'><" + localName + " /></svg>", "", localName) as SvgElement; - Assertion.AssertEquals("preserve", elm.XmlSpace); + Assert.AreEqual("preserve", elm.XmlSpace); } } Index: SvgMatrixTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgMatrixTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgMatrixTests.cs 3 Aug 2003 18:22:59 -0000 1.3 +++ SvgMatrixTests.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -1 +1 @@ -using System; using NUnit.Framework; using SharpVectors.Dom.Svg; namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces { // The resulting test values were generated using MuPad Light // NOTE: The original implementation of SvgMatrix returned doubles when accessing properties. To stay consistent with the SVG specification, these were switched to floats. The original double values used in the assertions have been left "just in case". They are being converted to floats using the trailing "f". [TestFixture] public class SvgMatrixTests { [Test] public void TestConstructor() { ISvgMatrix m = new SvgMatrix(); Assertion.AssertEquals(1, m.A); Assertion.AssertEquals(0, m.B); Assertion.AssertEquals(0, m.C); Assertion.AssertEquals(1, m.D); Assertion.AssertEquals(0, m.E); Assertion.AssertEquals(0, m.F); } [Test] public void TestConstructor2() { ISvgMatrix m = new SvgMatrix(1, 2, 3, 4, 5, 6); Assertion.AssertEquals(1, m.A); Assertion.AssertEquals(2, m.B); Assertion.AssertEquals(3, m.C); Assertion.AssertEquals(4, m.D); Assertion.AssertEquals(5, m.E); Assertion.AssertEquals(6, m.F); } [Test] public void TestMultiply() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = new SvgMatrix(7, 8, 9, 10, 11, 12); ISvgMatrix m3 = m1.Multiply(m2); Assertion.AssertEquals(31, m3.A); Assertion.AssertEquals(46, m3.B); Assertion.AssertEquals(39, m3.C); Assertion.AssertEquals(58, m3.D); Assertion.AssertEquals(52, m3.E); Assertion.AssertEquals(76, m3.F); } [Test] public void TestInverse() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Inverse(); Assertion.AssertEquals(-2, m2.A); Assertion.AssertEquals(1, m2.B); Assertion.AssertEquals(1.5, m2.C); Assertion.AssertEquals(-0.5, m2.D); Assertion.AssertEquals(1, m2.E); Assertion.AssertEquals(-2, m2.F); } [Test] [ExpectedException(typeof(SvgException))] public void TestNoInverse() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 6, 0, 0); ISvgMatrix m2 = m1.Inverse(); } [Test] public void TestTranslate() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Translate(10,20); Assertion.AssertEquals(1, m2.A); Assertion.AssertEquals(2, m2.B); Assertion.AssertEquals(3, m2.C); Assertion.AssertEquals(4, m2.D); Assertion.AssertEquals(75, m2.E); Assertion.AssertEquals(106, m2.F); } [Test] public void TestScale() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Scale(10); Assertion.AssertEquals(10, m2.A); Assertion.AssertEquals(20, m2.B); Assertion.AssertEquals(30, m2.C); Assertion.AssertEquals(40, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestScaleNonUniform() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.ScaleNonUniform(10,20); Assertion.AssertEquals(10, m2.A); Assertion.AssertEquals(20, m2.B); Assertion.AssertEquals(60, m2.C); Assertion.AssertEquals(80, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestRotate() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Rotate(30); Assertion.AssertEquals(2.36602540378444f, m2.A); Assertion.AssertEquals(3.73205080756888f, m2.B); Assertion.AssertEquals(2.09807621135332f, m2.C); Assertion.AssertEquals(2.46410161513775f, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestRotateFromVector() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.RotateFromVector(1.73205080756888f, 1); Assertion.AssertEquals(2.36602540378444f, m2.A); Assertion.AssertEquals(3.73205080756888f, m2.B); Assertion.AssertEquals(2.09807621135332f, m2.C); //D property incorrect when using doubles, probably due to rounding //Assertion.AssertEquals(2.46410161513775, m2.D); Assertion.AssertEquals(2.46410161513776f, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] [ExpectedException(typeof(SvgException))] public void TestRotateFromVectorZeroX() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 6, 0, 0); ISvgMatrix m2 = m1.RotateFromVector(0, 1); } [Test] [ExpectedException(typeof(SvgException))] public void TestRotateFromVectorZeroY() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 6, 0, 0); ISvgMatrix m2 = m1.RotateFromVector(1, 0); } [Test] public void TestFlipX() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.FlipX(); Assertion.AssertEquals(-1, m2.A); Assertion.AssertEquals(-2, m2.B); Assertion.AssertEquals(3, m2.C); Assertion.AssertEquals(4, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestFlipY() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.FlipY(); Assertion.AssertEquals(1, m2.A); Assertion.AssertEquals(2, m2.B); Assertion.AssertEquals(-3, m2.C); Assertion.AssertEquals(-4, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestSkewX() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.SkewX(30); Assertion.AssertEquals(1, m2.A); Assertion.AssertEquals(2, m2.B); Assertion.AssertEquals(3.57735026918963f, m2.C); Assertion.AssertEquals(5.15470053837925f, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestSkewY() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.SkewY(30); Assertion.AssertEquals(2.73205080756888f, m2.A); Assertion.AssertEquals(4.3094010767585f, m2.B); Assertion.AssertEquals(3, m2.C); Assertion.AssertEquals(4, m2.D); Assertion.AssertEquals(5, m2.E); Assertion.AssertEquals(6, m2.F); } [Test] public void TestMultiply2() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = new SvgMatrix(7, 8, 9, 10, 11, 12); SvgMatrix m3 = (SvgMatrix) m1 * (SvgMatrix) m2; Assertion.AssertEquals(31, m3.A); Assertion.AssertEquals(46, m3.B); Assertion.AssertEquals(39, m3.C); Assertion.AssertEquals(58, m3.D); Assertion.AssertEquals(52, m3.E); Assertion.AssertEquals(76, m3.F); } } } \ No newline at end of file +using System; using NUnit.Framework; using SharpVectors.Dom.Svg; namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces { // The resulting test values were generated using MuPad Light // NOTE: The original implementation of SvgMatrix returned doubles when accessing properties. To stay consistent with the SVG specification, these were switched to floats. The original double values used in the assertions have been left "just in case". They are being converted to floats using the trailing "f". [TestFixture] public class SvgMatrixTests { [Test] public void TestConstructor() { ISvgMatrix m = new SvgMatrix(); Assert.AreEqual(1, m.A); Assert.AreEqual(0, m.B); Assert.AreEqual(0, m.C); Assert.AreEqual(1, m.D); Assert.AreEqual(0, m.E); Assert.AreEqual(0, m.F); } [Test] public void TestConstructor2() { ISvgMatrix m = new SvgMatrix(1, 2, 3, 4, 5, 6); Assert.AreEqual(1, m.A); Assert.AreEqual(2, m.B); Assert.AreEqual(3, m.C); Assert.AreEqual(4, m.D); Assert.AreEqual(5, m.E); Assert.AreEqual(6, m.F); } [Test] public void TestMultiply() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = new SvgMatrix(7, 8, 9, 10, 11, 12); ISvgMatrix m3 = m1.Multiply(m2); Assert.AreEqual(31, m3.A); Assert.AreEqual(46, m3.B); Assert.AreEqual(39, m3.C); Assert.AreEqual(58, m3.D); Assert.AreEqual(52, m3.E); Assert.AreEqual(76, m3.F); } [Test] public void TestInverse() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Inverse(); Assert.AreEqual(-2, m2.A); Assert.AreEqual(1, m2.B); Assert.AreEqual(1.5, m2.C); Assert.AreEqual(-0.5, m2.D); Assert.AreEqual(1, m2.E); Assert.AreEqual(-2, m2.F); } [Test] [ExpectedException(typeof(SvgException))] public void TestNoInverse() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 6, 0, 0); ISvgMatrix m2 = m1.Inverse(); } [Test] public void TestTranslate() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Translate(10,20); Assert.AreEqual(1, m2.A); Assert.AreEqual(2, m2.B); Assert.AreEqual(3, m2.C); Assert.AreEqual(4, m2.D); Assert.AreEqual(75, m2.E); Assert.AreEqual(106, m2.F); } [Test] public void TestScale() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Scale(10); Assert.AreEqual(10, m2.A); Assert.AreEqual(20, m2.B); Assert.AreEqual(30, m2.C); Assert.AreEqual(40, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestScaleNonUniform() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.ScaleNonUniform(10,20); Assert.AreEqual(10, m2.A); Assert.AreEqual(20, m2.B); Assert.AreEqual(60, m2.C); Assert.AreEqual(80, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestRotate() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.Rotate(30); Assert.AreEqual(2.36602540378444f, m2.A); Assert.AreEqual(3.73205080756888f, m2.B); Assert.AreEqual(2.09807621135332f, m2.C); Assert.AreEqual(2.46410161513775f, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestRotateFromVector() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.RotateFromVector(1.73205080756888f, 1); Assert.AreEqual(2.36602540378444f, m2.A); Assert.AreEqual(3.73205080756888f, m2.B); Assert.AreEqual(2.09807621135332f, m2.C); //D property incorrect when using doubles, probably due to rounding //Assert.AreEqual(2.46410161513775, m2.D); Assert.AreEqual(2.46410161513776f, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] [ExpectedException(typeof(SvgException))] public void TestRotateFromVectorZeroX() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 6, 0, 0); ISvgMatrix m2 = m1.RotateFromVector(0, 1); } [Test] [ExpectedException(typeof(SvgException))] public void TestRotateFromVectorZeroY() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 6, 0, 0); ISvgMatrix m2 = m1.RotateFromVector(1, 0); } [Test] public void TestFlipX() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.FlipX(); Assert.AreEqual(-1, m2.A); Assert.AreEqual(-2, m2.B); Assert.AreEqual(3, m2.C); Assert.AreEqual(4, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestFlipY() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.FlipY(); Assert.AreEqual(1, m2.A); Assert.AreEqual(2, m2.B); Assert.AreEqual(-3, m2.C); Assert.AreEqual(-4, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestSkewX() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.SkewX(30); Assert.AreEqual(1, m2.A); Assert.AreEqual(2, m2.B); Assert.AreEqual(3.57735026918963f, m2.C); Assert.AreEqual(5.15470053837925f, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestSkewY() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = m1.SkewY(30); Assert.AreEqual(2.73205080756888f, m2.A); Assert.AreEqual(4.3094010767585f, m2.B); Assert.AreEqual(3, m2.C); Assert.AreEqual(4, m2.D); Assert.AreEqual(5, m2.E); Assert.AreEqual(6, m2.F); } [Test] public void TestMultiply2() { ISvgMatrix m1 = new SvgMatrix(1, 2, 3, 4, 5, 6); ISvgMatrix m2 = new SvgMatrix(7, 8, 9, 10, 11, 12); SvgMatrix m3 = (SvgMatrix) m1 * (SvgMatrix) m2; Assert.AreEqual(31, m3.A); Assert.AreEqual(46, m3.B); Assert.AreEqual(39, m3.C); Assert.AreEqual(58, m3.D); Assert.AreEqual(52, m3.E); Assert.AreEqual(76, m3.F); } } } \ No newline at end of file Index: SvgLengthTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgLengthTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgLengthTests.cs 27 May 2003 20:44:07 -0000 1.3 +++ SvgLengthTests.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -41,105 +41,105 @@ public void TestSettingValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10px"); - Assertion.AssertEquals(10, length.Value); - Assertion.AssertEquals(SvgLengthType.Px, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10px", length.ValueAsString); + Assert.AreEqual(10, length.Value); + Assert.AreEqual(SvgLengthType.Px, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10px", length.ValueAsString); length.ValueAsString = "10cm"; - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); length.Value = 200; double valueInCm = 200 / 96D * 2.54D; - Assertion.AssertEquals(200, length.Value); - Assertion.AssertEquals(valueInCm, length.ValueInSpecifiedUnits); - Assertion.AssertEquals(valueInCm.ToString(SvgNumber.Format)+"cm", length.ValueAsString); + Assert.AreEqual(200, length.Value); + Assert.AreEqual(valueInCm, length.ValueInSpecifiedUnits); + Assert.AreEqual(valueInCm.ToString(SvgNumber.Format)+"cm", length.ValueAsString); // change px value length.ValueAsString = "2px"; - Assertion.AssertEquals(2, length.Value); - Assertion.AssertEquals(2, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("2px", length.ValueAsString); + Assert.AreEqual(2, length.Value); + Assert.AreEqual(2, length.ValueInSpecifiedUnits); + Assert.AreEqual("2px", length.ValueAsString); // set to a CM value length.NewValueSpecifiedUnits(SvgLengthType.Cm, 23); - Assertion.AssertEquals(23, length.ValueInSpecifiedUnits); - Assertion.AssertEquals(23 / 2.54D * 96, length.Value); - Assertion.AssertEquals("23cm", length.ValueAsString); - Assertion.AssertEquals(SvgLengthType.Cm, length.UnitType); + Assert.AreEqual(23, length.ValueInSpecifiedUnits); + Assert.AreEqual(23 / 2.54D * 96, length.Value); + Assert.AreEqual("23cm", length.ValueAsString); + Assert.AreEqual(SvgLengthType.Cm, length.UnitType); length.ConvertToSpecifiedUnits(SvgLengthType.Mm); - Assertion.AssertEquals(230, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("230mm", length.ValueAsString); - Assertion.AssertEquals(SvgLengthType.Mm, length.UnitType); + Assert.AreEqual(230, length.ValueInSpecifiedUnits); + Assert.AreEqual("230mm", length.ValueAsString); + Assert.AreEqual(SvgLengthType.Mm, length.UnitType); } [Test] public void TestPxValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10px"); - Assertion.AssertEquals(10, length.Value); - Assertion.AssertEquals(SvgLengthType.Px, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10px", length.ValueAsString); + Assert.AreEqual(10, length.Value); + Assert.AreEqual(SvgLengthType.Px, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10px", length.ValueAsString); } [Test] public void TestCmValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10cm"); - Assertion.AssertEquals(10 / 2.54 * 96, length.Value); - Assertion.AssertEquals(SvgLengthType.Cm, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10cm", length.ValueAsString); + Assert.AreEqual(10 / 2.54 * 96, length.Value); + Assert.AreEqual(SvgLengthType.Cm, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10cm", length.ValueAsString); } [Test] public void TestMmValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10mm"); - Assertion.AssertEquals(10 / 25.4 * 96, length.Value); - Assertion.AssertEquals(SvgLengthType.Mm, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10mm", length.ValueAsString); + Assert.AreEqual(10 / 25.4 * 96, length.Value); + Assert.AreEqual(SvgLengthType.Mm, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10mm", length.ValueAsString); } [Test] public void TestInValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10in"); - Assertion.AssertEquals(10 * 96, length.Value); - Assertion.AssertEquals(SvgLengthType.In, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10in", length.ValueAsString); + Assert.AreEqual(10 * 96, length.Value); + Assert.AreEqual(SvgLengthType.In, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10in", length.ValueAsString); } [Test] public void TestPtValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10pt"); - Assertion.AssertEquals(10 / 72D * 96, length.Value); - Assertion.AssertEquals(SvgLengthType.Pt, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10pt", length.ValueAsString); + Assert.AreEqual(10 / 72D * 96, length.Value); + Assert.AreEqual(SvgLengthType.Pt, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10pt", length.ValueAsString); } [Test] public void TestPcValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10pc"); - Assertion.AssertEquals(10 / 6D * 96, length.Value); - Assertion.AssertEquals(SvgLengthType.Pc, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10pc", length.ValueAsString); + Assert.AreEqual(10 / 6D * 96, length.Value); + Assert.AreEqual(SvgLengthType.Pc, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10pc", length.ValueAsString); } [Test] public void TestEmValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10em"); - Assertion.AssertEquals(SvgLengthType.Ems, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10em", length.ValueAsString); + Assert.AreEqual(SvgLengthType.Ems, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10em", length.ValueAsString); } [Test] @@ -147,16 +147,16 @@ public void TestEmToAbsValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10em"); - Assertion.AssertEquals(100, length.Value); + Assert.AreEqual(100, length.Value); } [Test] public void TestExValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10ex"); - Assertion.AssertEquals(SvgLengthType.Exs, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10ex", length.ValueAsString); + Assert.AreEqual(SvgLengthType.Exs, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10ex", length.ValueAsString); } [Test] @@ -164,40 +164,40 @@ public void TestExToAbsValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10ex"); - Assertion.AssertEquals(60, length.Value); + Assert.AreEqual(60, length.Value); } [Test] public void TestPercentValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "10%"); - Assertion.AssertEquals(20, length.Value); - Assertion.AssertEquals(SvgLengthType.Percentage, length.UnitType); - Assertion.AssertEquals(10, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("10%", length.ValueAsString); + Assert.AreEqual(20, length.Value); + Assert.AreEqual(SvgLengthType.Percentage, length.UnitType); + Assert.AreEqual(10, length.ValueInSpecifiedUnits); + Assert.AreEqual("10%", length.ValueAsString); length = new SvgLength(elm, "test", SvgLengthDirection.Vertical, "20%"); - Assertion.AssertEquals(60, length.Value); + Assert.AreEqual(60, length.Value); length = new SvgLength(elm, "test", SvgLengthDirection.Viewport, "10%"); - Assertion.AssertEquals(Math.Sqrt(200*200+300*300)/Math.Sqrt(2) * 0.1D, length.Value); + Assert.AreEqual(Math.Sqrt(200*200+300*300)/Math.Sqrt(2) * 0.1D, length.Value); } [Test] public void TestScientificValues() { length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "2E3px"); - Assertion.AssertEquals(2000, length.Value); - Assertion.AssertEquals(SvgLengthType.Px, length.UnitType); - Assertion.AssertEquals(2000, length.ValueInSpecifiedUnits); - Assertion.AssertEquals("2000px", length.ValueAsString); + Assert.AreEqual(2000, length.Value); + Assert.AreEqual(SvgLengthType.Px, length.UnitType); + Assert.AreEqual(2000, length.ValueInSpecifiedUnits); + Assert.AreEqual("2000px", length.ValueAsString); length = new SvgLength(elm, "test", SvgLengthDirection.Horizontal, "1E-1px"); - Assertion.Assert("Value", Math.Abs(0.1D-length.Value)<0.0001); - Assertion.AssertEquals(SvgLengthType.Px, length.UnitType); - Assertion.Assert("ValueInSpecifiedUnits", Math.Abs(0.1D-length.ValueInSpecifiedUnits)<0.0001); - //Assertion.AssertEquals("0.1px", length.ValueAsString); + Assert.IsTrue(Math.Abs(0.1D-length.Value)<0.0001, "Value"); + Assert.AreEqual(SvgLengthType.Px, length.UnitType); + Assert.IsTrue(Math.Abs(0.1D-length.ValueInSpecifiedUnits)<0.0001, "ValueInSpecifiedUnits"); + //Assert.AreEqual("0.1px", length.ValueAsString); } } Index: SvgNumberListTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgNumberListTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgNumberListTests.cs 26 Apr 2003 19:50:04 -0000 1.2 +++ SvgNumberListTests.cs 20 Nov 2005 20:42:23 -0000 1.3 @@ -1,130 +1,260 @@ -using System; -using NUnit.Framework; -using SharpVectors.Dom; -using SharpVectors.Dom.Svg; - -namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces -{ - public class SvgNumberListTests : SvgListTests - { - #region Fields - private static int counter = 0; - #endregion - - #region Additional SvgStringList-specific tests - [Test] - public void TestFromStringEmpty() - { - ((SvgNumberList) list).FromString(""); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringNull() - { - ((SvgNumberList) list).FromString(null); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringLeadingWhitespace() - { - ((SvgNumberList) list).FromString(" 1 2 3 4"); - Assertion.AssertEquals(1, ((SvgNumberList) list).GetItem(0).Value); - Assertion.AssertEquals(2, ((SvgNumberList) list).GetItem(1).Value); - Assertion.AssertEquals(3, ((SvgNumberList) list).GetItem(2).Value); - Assertion.AssertEquals(4, ((SvgNumberList) list).GetItem(3).Value); - } - - [Test] - public void TestFromStringTrailingWhitespace() - { - ((SvgNumberList) list).FromString("1 2 3 4 "); - Assertion.AssertEquals(1, ((SvgNumberList) list).GetItem(0).Value); - Assertion.AssertEquals(2, ((SvgNumberList) list).GetItem(1).Value); - Assertion.AssertEquals(3, ((SvgNumberList) list).GetItem(2).Value); - Assertion.AssertEquals(4, ((SvgNumberList) list).GetItem(3).Value); - } - - [Test] - public void TestFromStringOneValue() - { - ((SvgNumberList) list).FromString("1"); - Assertion.AssertEquals(1, ((SvgNumberList) list).GetItem(0).Value); - } - - [Test] - public void TestFromStringSpaceDelimited() - { - ((SvgNumberList) list).FromString("1 2 3 4"); - Assertion.AssertEquals(1, ((SvgNumberList) list).GetItem(0).Value); - Assertion.AssertEquals(2, ((SvgNumberList) list).GetItem(1).Value); - Assertion.AssertEquals(3, ((SvgNumberList) list).GetItem(2).Value); - Assertion.AssertEquals(4, ((SvgNumberList) list).GetItem(3).Value); - } - - [Test] - public void TestFromStringCommaDelimited() - { - ((SvgNumberList) list).FromString("1,2, 3 ,4 , 5"); - Assertion.AssertEquals(1, ((SvgNumberList) list).GetItem(0).Value); - Assertion.AssertEquals(2, ((SvgNumberList) list).GetItem(1).Value); - Assertion.AssertEquals(3, ((SvgNumberList) list).GetItem(2).Value); - Assertion.AssertEquals(4, ((SvgNumberList) list).GetItem(3).Value); - Assertion.AssertEquals(5, ((SvgNumberList) list).GetItem(4).Value); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas() - { - ((SvgNumberList) list).FromString("1,,2"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas2() - { - ((SvgNumberList) list).FromString("1, ,2"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas3() - { - ((SvgNumberList) list).FromString("1 , ,2"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas4() - { - ((SvgNumberList) list).FromString("1 , , 2"); - } - - [Test] - public void TestFromStringMixed() - { - ((SvgNumberList) list).FromString("1 2 3,4 ,5 , 6"); - Assertion.AssertEquals(1, ((SvgNumberList) list).GetItem(0).Value); - Assertion.AssertEquals(2, ((SvgNumberList) list).GetItem(1).Value); - Assertion.AssertEquals(3, ((SvgNumberList) list).GetItem(2).Value); - Assertion.AssertEquals(4, ((SvgNumberList) list).GetItem(3).Value); - Assertion.AssertEquals(5, ((SvgNumberList) list).GetItem(4).Value); - Assertion.AssertEquals(6, ((SvgNumberList) list).GetItem(5).Value); - } - #endregion - - #region Support Methods - protected override SvgList makeList() - { - return new SvgNumberList(); - } - - protected new SvgNumber makeItem() - { - return new SvgNumber(counter++); - } - #endregion - } -} +using System; + +using NUnit.Framework; + +using SharpVectors.Dom; + +using SharpVectors.Dom.Svg; + + + +namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces + +{ + + public class SvgNumberListTests : SvgListTests + + { + + #region Fields + + private static int counter = 0; + + #endregion + + + + #region Additional SvgStringList-specific tests + + [Test] + + public void TestFromStringEmpty() + + { + + ((SvgNumberList) list).FromString(""); + + Assert.AreEqual(0, list.NumberOfItems); + + } + + + + [Test] + + public void TestFromStringNull() + + { + + ((SvgNumberList) list).FromString(null); + + Assert.AreEqual(0, list.NumberOfItems); + + } + + + + [Test] + + public void TestFromStringLeadingWhitespace() + + { + + ((SvgNumberList) list).FromString(" 1 2 3 4"); + + Assert.AreEqual(1, ((SvgNumberList) list).GetItem(0).Value); + + Assert.AreEqual(2, ((SvgNumberList) list).GetItem(1).Value); + + Assert.AreEqual(3, ((SvgNumberList) list).GetItem(2).Value); + + Assert.AreEqual(4, ((SvgNumberList) list).GetItem(3).Value); + + } + + + + [Test] + + public void TestFromStringTrailingWhitespace() + + { + + ((SvgNumberList) list).FromString("1 2 3 4 "); + + Assert.AreEqual(1, ((SvgNumberList) list).GetItem(0).Value); + + Assert.AreEqual(2, ((SvgNumberList) list).GetItem(1).Value); + + Assert.AreEqual(3, ((SvgNumberList) list).GetItem(2).Value); + + Assert.AreEqual(4, ((SvgNumberList) list).GetItem(3).Value); + + } + + + + [Test] + + public void TestFromStringOneValue() + + { + + ((SvgNumberList) list).FromString("1"); + + Assert.AreEqual(1, ((SvgNumberList) list).GetItem(0).Value); + + } + + + + [Test] + + public void TestFromStringSpaceDelimited() + + { + + ((SvgNumberList) list).FromString("1 2 3 4"); + + Assert.AreEqual(1, ((SvgNumberList) list).GetItem(0).Value); + + Assert.AreEqual(2, ((SvgNumberList) list).GetItem(1).Value); + + Assert.AreEqual(3, ((SvgNumberList) list).GetItem(2).Value); + + Assert.AreEqual(4, ((SvgNumberList) list).GetItem(3).Value); + + } + + + + [Test] + + public void TestFromStringCommaDelimited() + + { + + ((SvgNumberList) list).FromString("1,2, 3 ,4 , 5"); + + Assert.AreEqual(1, ((SvgNumberList) list).GetItem(0).Value); + + Assert.AreEqual(2, ((SvgNumberList) list).GetItem(1).Value); + + Assert.AreEqual(3, ((SvgNumberList) list).GetItem(2).Value); + + Assert.AreEqual(4, ((SvgNumberList) list).GetItem(3).Value); + + Assert.AreEqual(5, ((SvgNumberList) list).GetItem(4).Value); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas() + + { + + ((SvgNumberList) list).FromString("1,,2"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas2() + + { + + ((SvgNumberList) list).FromString("1, ,2"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas3() + + { + + ((SvgNumberList) list).FromString("1 , ,2"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas4() + + { + + ((SvgNumberList) list).FromString("1 , , 2"); + + } + + + + [Test] + + public void TestFromStringMixed() + + { + + ((SvgNumberList) list).FromString("1 2 3,4 ,5 , 6"); + + Assert.AreEqual(1, ((SvgNumberList) list).GetItem(0).Value); + + Assert.AreEqual(2, ((SvgNumberList) list).GetItem(1).Value); + + Assert.AreEqual(3, ((SvgNumberList) list).GetItem(2).Value); + + Assert.AreEqual(4, ((SvgNumberList) list).GetItem(3).Value); + + Assert.AreEqual(5, ((SvgNumberList) list).GetItem(4).Value); + + Assert.AreEqual(6, ((SvgNumberList) list).GetItem(5).Value); + + } + + #endregion + + + + #region Support Methods + + protected override SvgList makeList() + + { + + return new SvgNumberList(); + + } + + + + protected new SvgNumber makeItem() + + { + + return new SvgNumber(counter++); + + } + + #endregion + + } + +} + Index: SvgTransformListTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgTransformListTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgTransformListTests.cs 26 Apr 2003 19:50:04 -0000 1.2 +++ SvgTransformListTests.cs 20 Nov 2005 20:42:23 -0000 1.3 @@ -1,134 +1,268 @@ -using System; -using NUnit.Framework; -using SharpVectors.Dom; -using SharpVectors.Dom.Svg; - -namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces -{ - public class SvgTransformListTests : SvgListTests - { - #region Fields - private static int counter = 0; - #endregion - - #region Additional SvgTransformList-specific tests - /* - [Test] - public void TestFromStringEmpty() - { - ((SvgStringList) list).FromString(""); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringNull() - { - ((SvgStringList) list).FromString(null); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringLeadingWhitespace() - { - ((SvgStringList) list).FromString(" one two three four"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - } - - [Test] - public void TestFromStringTrailingWhitespace() - { - ((SvgStringList) list).FromString("one two three four "); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - } - - [Test] - public void TestFromStringOneValue() - { - ((SvgStringList) list).FromString("one"); - Assertion.AssertEquals("one", list.GetItem(0)); - } - - [Test] - public void TestFromStringSpaceDelimited() - { - ((SvgStringList) list).FromString("one two three four"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - } - - [Test] - public void TestFromStringCommaDelimited() - { - ((SvgStringList) list).FromString("one,two, three ,four , five"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - Assertion.AssertEquals("five", list.GetItem(4)); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas() - { - ((SvgStringList) list).FromString("one,,two"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas2() - { - ((SvgStringList) list).FromString("one, ,two"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas3() - { - ((SvgStringList) list).FromString("one , ,two"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas4() - { - ((SvgStringList) list).FromString("one , , two"); - } - - [Test] - public void TestFromStringMixed() - { - ((SvgStringList) list).FromString("one two three,four ,five , six"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - Assertion.AssertEquals("five", list.GetItem(4)); - Assertion.AssertEquals("six", list.GetItem(5)); - } - */ - #endregion - - #region Support Methods - protected override SvgList makeList() - { - return new SvgTransformList(); - } - - protected new SvgTransform makeItem() - { - string scale = (counter++).ToString(); - - return new SvgTransform("matrix(" + scale + ",0,0," + scale + ",0,0"); - } - #endregion - } -} +using System; + +using NUnit.Framework; + +using SharpVectors.Dom; + +using SharpVectors.Dom.Svg; + + + +namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces + +{ + + public class SvgTransformListTests : SvgListTests + + { + + #region Fields + + private static int counter = 0; + + #endregion + + + + #region Additional SvgTransformList-specific tests + + /* + + [Test] + + public void TestFromStringEmpty() + + { + + ((SvgStringList) list).FromString(""); + + Assert.AreEqual(0, list.NumberOfItems); + + } + + + + [Test] + + public void TestFromStringNull() + + { + + ((SvgStringList) list).FromString(null); + + Assert.AreEqual(0, list.NumberOfItems); + + } + + + + [Test] + + public void TestFromStringLeadingWhitespace() + + { + + ((SvgStringList) list).FromString(" one two three four"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + } + + + + [Test] + + public void TestFromStringTrailingWhitespace() + + { + + ((SvgStringList) list).FromString("one two three four "); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + } + + + + [Test] + + public void TestFromStringOneValue() + + { + + ((SvgStringList) list).FromString("one"); + + Assert.AreEqual("one", list.GetItem(0)); + + } + + + + [Test] + + public void TestFromStringSpaceDelimited() + + { + + ((SvgStringList) list).FromString("one two three four"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + } + + + + [Test] + + public void TestFromStringCommaDelimited() + + { + + ((SvgStringList) list).FromString("one,two, three ,four , five"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + Assert.AreEqual("five", list.GetItem(4)); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas() + + { + + ((SvgStringList) list).FromString("one,,two"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas2() + + { + + ((SvgStringList) list).FromString("one, ,two"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas3() + + { + + ((SvgStringList) list).FromString("one , ,two"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas4() + + { + + ((SvgStringList) list).FromString("one , , two"); + + } + + + + [Test] + + public void TestFromStringMixed() + + { + + ((SvgStringList) list).FromString("one two three,four ,five , six"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + Assert.AreEqual("five", list.GetItem(4)); + + Assert.AreEqual("six", list.GetItem(5)); + + } + + */ + + #endregion + + + + #region Support Methods + + protected override SvgList makeList() + + { + + return new SvgTransformList(); + + } + + + + protected new SvgTransform makeItem() + + { + + string scale = (counter++).ToString(); + + + + return new SvgTransform("matrix(" + scale + ",0,0," + scale + ",0,0"); + + } + + #endregion + + } + +} + Index: SvgStringListTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgStringListTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgStringListTests.cs 26 Apr 2003 19:50:04 -0000 1.2 +++ SvgStringListTests.cs 20 Nov 2005 20:42:23 -0000 1.3 @@ -1,130 +1,260 @@ -using System; -using NUnit.Framework; -using SharpVectors.Dom; -using SharpVectors.Dom.Svg; - -namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces -{ - public class SvgStringListTests : SvgListTests - { - #region Fields - private static int counter = 0; - #endregion - - #region Additional SvgStringList-specific tests - [Test] - public void TestFromStringEmpty() - { - ((SvgStringList) list).FromString(""); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringNull() - { - ((SvgStringList) list).FromString(null); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringLeadingWhitespace() - { - ((SvgStringList) list).FromString(" one two three four"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - } - - [Test] - public void TestFromStringTrailingWhitespace() - { - ((SvgStringList) list).FromString("one two three four "); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - } - - [Test] - public void TestFromStringOneValue() - { - ((SvgStringList) list).FromString("one"); - Assertion.AssertEquals("one", list.GetItem(0)); - } - - [Test] - public void TestFromStringSpaceDelimited() - { - ((SvgStringList) list).FromString("one two three four"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - } - - [Test] - public void TestFromStringCommaDelimited() - { - ((SvgStringList) list).FromString("one,two, three ,four , five"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - Assertion.AssertEquals("five", list.GetItem(4)); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas() - { - ((SvgStringList) list).FromString("one,,two"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas2() - { - ((SvgStringList) list).FromString("one, ,two"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas3() - { - ((SvgStringList) list).FromString("one , ,two"); - } - - [Test] - [ExpectedException(typeof(DomException))] - public void TestFromStringMultipleCommas4() - { - ((SvgStringList) list).FromString("one , , two"); - } - - [Test] - public void TestFromStringMixed() - { - ((SvgStringList) list).FromString("one two three,four ,five , six"); - Assertion.AssertEquals("one", list.GetItem(0)); - Assertion.AssertEquals("two", list.GetItem(1)); - Assertion.AssertEquals("three", list.GetItem(2)); - Assertion.AssertEquals("four", list.GetItem(3)); - Assertion.AssertEquals("five", list.GetItem(4)); - Assertion.AssertEquals("six", list.GetItem(5)); - } - #endregion - - #region Support Methods - protected override SvgList makeList() - { - return new SvgStringList(); - } - - protected new string makeItem() - { - return "string" + (counter++).ToString(); - } - #endregion - } -} +using System; + +using NUnit.Framework; + +using SharpVectors.Dom; + +using SharpVectors.Dom.Svg; + + + +namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces + +{ + + public class SvgStringListTests : SvgListTests + + { + + #region Fields + + private static int counter = 0; + + #endregion + + + + #region Additional SvgStringList-specific tests + + [Test] + + public void TestFromStringEmpty() + + { + + ((SvgStringList) list).FromString(""); + + Assert.AreEqual(0, list.NumberOfItems); + + } + + + + [Test] + + public void TestFromStringNull() + + { + + ((SvgStringList) list).FromString(null); + + Assert.AreEqual(0, list.NumberOfItems); + + } + + + + [Test] + + public void TestFromStringLeadingWhitespace() + + { + + ((SvgStringList) list).FromString(" one two three four"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + } + + + + [Test] + + public void TestFromStringTrailingWhitespace() + + { + + ((SvgStringList) list).FromString("one two three four "); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + } + + + + [Test] + + public void TestFromStringOneValue() + + { + + ((SvgStringList) list).FromString("one"); + + Assert.AreEqual("one", list.GetItem(0)); + + } + + + + [Test] + + public void TestFromStringSpaceDelimited() + + { + + ((SvgStringList) list).FromString("one two three four"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + } + + + + [Test] + + public void TestFromStringCommaDelimited() + + { + + ((SvgStringList) list).FromString("one,two, three ,four , five"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + Assert.AreEqual("five", list.GetItem(4)); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas() + + { + + ((SvgStringList) list).FromString("one,,two"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas2() + + { + + ((SvgStringList) list).FromString("one, ,two"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas3() + + { + + ((SvgStringList) list).FromString("one , ,two"); + + } + + + + [Test] + + [ExpectedException(typeof(DomException))] + + public void TestFromStringMultipleCommas4() + + { + + ((SvgStringList) list).FromString("one , , two"); + + } + + + + [Test] + + public void TestFromStringMixed() + + { + + ((SvgStringList) list).FromString("one two three,four ,five , six"); + + Assert.AreEqual("one", list.GetItem(0)); + + Assert.AreEqual("two", list.GetItem(1)); + + Assert.AreEqual("three", list.GetItem(2)); + + Assert.AreEqual("four", list.GetItem(3)); + + Assert.AreEqual("five", list.GetItem(4)); + + Assert.AreEqual("six", list.GetItem(5)); + + } + + #endregion + + + + #region Support Methods + + protected override SvgList makeList() + + { + + return new SvgStringList(); + + } + + + + protected new string makeItem() + + { + + return "string" + (counter++).ToString(); + + } + + #endregion + + } + +} + Index: SvgLengthListTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Basic types/SvgLengthListTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgLengthListTests.cs 26 Apr 2003 19:50:04 -0000 1.2 +++ SvgLengthListTests.cs 20 Nov 2005 20:42:23 -0000 1.3 @@ -1,163 +1 @@ -using System; -using NUnit.Framework; -using SharpVectors.Dom; -using SharpVectors.Dom.Svg; - -namespace SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces -{ - public class SvgLengthListTests : SvgListTests - { - #region Fields - private static int counter = 0; - #endregion - - #region Additional SvgLengthList-specific tests - [Test] - public void TestFromStringEmpty() - { - ((SvgLengthList) list).FromString(""); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - public void TestFromStringNull() - { - ((SvgLengthList) list).FromString(null); - Assertion.AssertEquals(0, list.NumberOfItems); - } - - [Test] - - public void TestFromStringLeadingWhitespace() - { - SvgLengthList svgLengthList = (SvgLengthList) list; - - svgLengthList.FromString(" 1px 2em 3in 4cm"); - Assertion.AssertEquals(1, svgLengthList.GetItem(0).ValueInSpecifiedUnits); - Assertion.AssertEquals(SvgLengthType.Px, svgLengthList.GetItem(0).UnitType); - Assertion.AssertEquals(2, svgLengthList.GetItem(1).ValueInSpecifiedUnits); - Assertion.AssertE... [truncated message content] |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:37
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure Modified Files: SvgDocumentTests.cs SvgImageElementTests.cs SvgStyleableElementTests.cs SvgTransformableElementTests.cs SvgUseElementTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgTransformableElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure/SvgTransformableElementTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgTransformableElementTests.cs 27 May 2003 20:44:08 -0000 1.2 +++ SvgTransformableElementTests.cs 20 Nov 2005 20:42:24 -0000 1.3 @@ -6,10 +6,10 @@ { SvgTransformableElement elm = Util.GetXmlElement("<g><rect x='1' y='2' width='3' height='4' /></g>", "", "g") as SvgTransformableElement; ISvgRect rect = elm.GetBBox(); - Assertion.AssertEquals(1, rect.X); - Assertion.AssertEquals(2, rect.Y); - Assertion.AssertEquals(3, rect.Width); - Assertion.AssertEquals(4, rect.Height); + Assert.AreEqual(1, rect.X); + Assert.AreEqual(2, rect.Y); + Assert.AreEqual(3, rect.Width); + Assert.AreEqual(4, rect.Height); } [Test] @@ -17,10 +17,10 @@ { SvgTransformableElement elm = Util.GetXmlElement("<g><rect x='1' y='2' width='3' height='4' /><rect x='10' y='20' width='3' height='4' /></g>", "", "g") as SvgTransformableElement; ISvgRect rect = elm.GetBBox(); - Assertion.AssertEquals(1, rect.X); - Assertion.AssertEquals(2, rect.Y); - Assertion.AssertEquals(12, rect.Width); - Assertion.AssertEquals(22, rect.Height); + Assert.AreEqual(1, rect.X); + Assert.AreEqual(2, rect.Y); + Assert.AreEqual(12, rect.Width); + Assert.AreEqual(22, rect.Height); } [Test] @@ -28,10 +28,10 @@ { SvgTransformableElement elm = Util.GetXmlElement("<rect x='1' y='2' width='3' height='4' />", "", "rect") as SvgTransformableElement; ISvgRect rect = elm.GetBBox(); - Assertion.AssertEquals(1, rect.X); - Assertion.AssertEquals(2, rect.Y); - Assertion.AssertEquals(3, rect.Width); - Assertion.AssertEquals(4, rect.Height); + Assert.AreEqual(1, rect.X); + Assert.AreEqual(2, rect.Y); + Assert.AreEqual(3, rect.Width); + Assert.AreEqual(4, rect.Height); } } } Index: SvgUseElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure/SvgUseElementTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgUseElementTests.cs 23 Oct 2005 23:39:29 -0000 1.3 +++ SvgUseElementTests.cs 20 Nov 2005 20:42:24 -0000 1.4 @@ -26,10 +26,10 @@ { SvgUseElement elm = Util.GetXmlElement("<use x='1' y='2' width='3' height='4' />", "", "use") as SvgUseElement; - Assertion.AssertEquals(1, elm.X.AnimVal.Value); - Assertion.AssertEquals(2, elm.Y.AnimVal.Value); - Assertion.AssertEquals(3, elm.Width.AnimVal.Value); - Assertion.AssertEquals(4, elm.Height.AnimVal.Value); + Assert.AreEqual(1, elm.X.AnimVal.Value); + Assert.AreEqual(2, elm.Y.AnimVal.Value); + Assert.AreEqual(3, elm.Width.AnimVal.Value); + Assert.AreEqual(4, elm.Height.AnimVal.Value); } [Test] @@ -37,9 +37,9 @@ { SvgUseElement elm = Util.GetXmlElement("<use xlink:href='#foo' /><rect id='foo' width='100' height='100' />", "", "use") as SvgUseElement; SvgRectElement rect = elm.OwnerDocument.SelectSingleNode("//*[@id='foo']") as SvgRectElement; - Assertion.AssertNotNull(elm.InstanceRoot); - Assertion.AssertEquals(elm, elm.InstanceRoot.CorrespondingUseElement); - Assertion.AssertEquals(rect, elm.InstanceRoot.CorrespondingElement); + Assert.IsNotNull(elm.InstanceRoot); + Assert.AreEqual(elm, elm.InstanceRoot.CorrespondingUseElement); + Assert.AreEqual(rect, elm.InstanceRoot.CorrespondingElement); } } } Index: SvgDocumentTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure/SvgDocumentTests.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SvgDocumentTests.cs 23 Oct 2005 23:39:29 -0000 1.4 +++ SvgDocumentTests.cs 20 Nov 2005 20:42:24 -0000 1.5 @@ -1,6 +1 @@ -using System; using System.IO; using System.Xml; using NUnit.Framework; using SharpVectors.Dom.Svg; namespace SharpVectors.UnitTests.Svg.DocumentStructure { [TestFixture] public class SvgDocumentTests { #region Fields private ISvgDocument document; private string baseDir = @"Dom.Svg\"; private SvgWindow window = new SvgWindow(75,75, null); #endregion #region Title tests [Test] public void TestEmptyTitle() { Load("title_empty.svg"); Assertion.AssertEquals("", document.Title); } [Test] public void TestTitle() { Load("title.svg"); Assertion.AssertEquals("This is a test title", document.Title); } [Test] public void TestMultipleTitles() { Load("title_multiple.svg"); Assertion.AssertEquals("This is the title", document.Title); } [Test] public void TestNestedTitle() { Load("title_nested.svg"); Assertion.AssertEquals("", document.Title); } [Test] public void TestMultilineTitle() { Load("title_multiline.svg"); Assertion.AssertEquals("This is a title using multiple lines", document.Title); } #endregion #region Referrer and Domain [Test] public void TestReferrer() - { Load("title_empty.svg"); Assertion.AssertEquals("", document.Referrer); } [Test] public void TestUnknownDomain() - { Load("title_empty.svg"); Assertion.AssertNull(document.Domain); } [Test] public void TestKnownDomain() - { SvgWindow wnd = new SvgWindow(75, 75, null); SvgDocument doc = new SvgDocument(wnd); doc.Load("http://www.shiny-donkey.com/shinyDonkey.svg"); Assertion.AssertEquals("www.shiny-donkey.com", doc.Domain); } #endregion [Test] public void TestRootElement() - { Load("title_empty.svg"); Assertion.AssertSame(((XmlDocument)document).DocumentElement, document.RootElement); } [Test] public void TestWindow() - { Load("title_empty.svg"); Assertion.AssertSame(window, document.Window); } #region Support Methods private void Load(string svgFile) { string fullPath = new FileInfo(baseDir+svgFile).FullName; window.Src = fullPath; document = window.Document; } #endregion } } \ No newline at end of file +using System; using System.IO; using System.Xml; using NUnit.Framework; using SharpVectors.Dom.Svg; namespace SharpVectors.UnitTests.Svg.DocumentStructure { [TestFixture] public class SvgDocumentTests { #region Fields private ISvgDocument document; private string baseDir = @"Dom.Svg\"; private SvgWindow window = new SvgWindow(75,75, null); #endregion #region Title tests [Test] public void TestEmptyTitle() { Load("title_empty.svg"); Assert.AreEqual("", document.Title); } [Test] public void TestTitle() { Load("title.svg"); Assert.AreEqual("This is a test title", document.Title); } [Test] public void TestMultipleTitles() { Load("title_multiple.svg"); Assert.AreEqual("This is the title", document.Title); } [Test] public void TestNestedTitle() { Load("title_nested.svg"); Assert.AreEqual("", document.Title); } [Test] public void TestMultilineTitle() { Load("title_multiline.svg"); Assert.AreEqual("This is a title using multiple lines", document.Title); } #endregion #region Referrer and Domain [Test] public void TestReferrer() { Load("title_empty.svg"); Assert.AreEqual("", document.Referrer); } [Test] public void TestUnknownDomain() { Load("title_empty.svg"); Assert.IsNull(document.Domain); } [Test] public void TestKnownDomain() { SvgWindow wnd = new SvgWindow(75, 75, null); SvgDocument doc = new SvgDocument(wnd); doc.Load("http://www.shiny-donkey.com/shinyDonkey.svg"); Assert.AreEqual("www.shiny-donkey.com", doc.Domain); } #endregion [Test] public void TestRootElement() { Load("title_empty.svg"); Assert.AreSame(((XmlDocument)document).DocumentElement, document.RootElement); } [Test] public void TestWindow() { Load("title_empty.svg"); Assert.AreSame(window, document.Window); } #region Support Methods private void Load(string svgFile) { string fullPath = new FileInfo(baseDir+svgFile).FullName; window.Src = fullPath; document = window.Document; } #endregion } } \ No newline at end of file Index: SvgImageElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure/SvgImageElementTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgImageElementTests.cs 1 May 2003 14:15:36 -0000 1.3 +++ SvgImageElementTests.cs 20 Nov 2005 20:42:24 -0000 1.4 @@ -31,14 +31,14 @@ { string url = "http://www.protocol7.com/images/logo.png"; SvgImageElement elm = getElm(url); - Assertion.AssertEquals(url, elm.Href.AnimVal); + Assert.AreEqual(url, elm.Href.AnimVal); - Assertion.AssertEquals(false, elm.IsSvgImage); - Assertion.AssertNull(elm.SvgWindow); + Assert.AreEqual(false, elm.IsSvgImage); + Assert.IsNull(elm.SvgWindow); - Assertion.AssertNotNull(elm.Bitmap); - Assertion.AssertEquals(350, elm.Bitmap.Width); - Assertion.AssertEquals(128, elm.Bitmap.Height); + Assert.IsNotNull(elm.Bitmap); + Assert.AreEqual(350, elm.Bitmap.Width); + Assert.AreEqual(128, elm.Bitmap.Height); } [Test] @@ -46,13 +46,13 @@ { string url = "http://www.w3.org/Graphics/SVG/Test/20021112/svggen/color-prof-01-f.svg"; SvgImageElement elm = getElm(url); - Assertion.AssertEquals(url, elm.Href.AnimVal); + Assert.AreEqual(url, elm.Href.AnimVal); - Assertion.AssertEquals(true, elm.IsSvgImage); - Assertion.AssertNull(elm.Bitmap); + Assert.AreEqual(true, elm.IsSvgImage); + Assert.IsNull(elm.Bitmap); - Assertion.AssertNotNull("Window", elm.SvgWindow); - Assertion.AssertNotNull("Document", elm.SvgWindow.Document); + Assert.IsNotNull(elm.SvgWindow, "Window"); + Assert.IsNotNull(elm.SvgWindow.Document, "Document"); } } } Index: SvgStyleableElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Document structure/SvgStyleableElementTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SvgStyleableElementTests.cs 26 Apr 2003 19:50:04 -0000 1.1 +++ SvgStyleableElementTests.cs 20 Nov 2005 20:42:24 -0000 1.2 @@ -1,4 +1,14 @@ -using System; using System.IO; using NUnit.Framework; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Css; using SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces; namespace SharpVectors.UnitTests.Svg.DocumentStructure { [TestFixture] +using System; +using System.IO; +using NUnit.Framework; +using SharpVectors.Dom.Svg; +using SharpVectors.Dom.Css; + +using SharpVectors.UnitTests.Svg.BasicTypesAndInterfaces; + +namespace SharpVectors.UnitTests.Svg.DocumentStructure +{ + [TestFixture] public class SvgStyleableElementTests : SvgElementTests { #region Utils for SvgElementTests @@ -19,35 +29,35 @@ public void NoClass() { SvgStyleableElement elm = Util.GetXmlElement("<title />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals("", elm.ClassName.AnimVal); + Assert.AreEqual("", elm.ClassName.AnimVal); } [Test] public void EmptyClass() { SvgStyleableElement elm = Util.GetXmlElement("<title class='' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals("", elm.ClassName.AnimVal); + Assert.AreEqual("", elm.ClassName.AnimVal); } [Test] public void SingleClass() { SvgStyleableElement elm = Util.GetXmlElement("<title class='foo' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals("foo", elm.ClassName.AnimVal); + Assert.AreEqual("foo", elm.ClassName.AnimVal); } [Test] public void SingleClassDontTrim() { SvgStyleableElement elm = Util.GetXmlElement("<title class=' foo ' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals(" foo ", elm.ClassName.AnimVal); + Assert.AreEqual(" foo ", elm.ClassName.AnimVal); } [Test] public void MultipleClasses() { SvgStyleableElement elm = Util.GetXmlElement("<title class='foo bar run' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals("foo bar run", elm.ClassName.AnimVal); + Assert.AreEqual("foo bar run", elm.ClassName.AnimVal); } #endregion @@ -56,7 +66,7 @@ public void PresAttNonExisting() { SvgStyleableElement elm = Util.GetXmlElement("<title />", "", "title") as SvgStyleableElement; - Assertion.AssertNull(elm.GetPresentationAttribute("dummy")); + Assert.IsNull(elm.GetPresentationAttribute("dummy")); } [Test] @@ -64,7 +74,7 @@ { SvgStyleableElement elm = Util.GetXmlElement("<title fill='black' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); + Assert.AreEqual(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); } @@ -72,40 +82,40 @@ public void PresAttSettingNew() { SvgStyleableElement elm = Util.GetXmlElement("<title />", "", "title") as SvgStyleableElement; - Assertion.AssertNull(elm.GetPresentationAttribute("stroke")); + Assert.IsNull(elm.GetPresentationAttribute("stroke")); elm.SetAttribute("stroke", "red"); - Assertion.AssertEquals(CssValue.GetCssValue("red", false).CssText, elm.GetPresentationAttribute("stroke").CssText); + Assert.AreEqual(CssValue.GetCssValue("red", false).CssText, elm.GetPresentationAttribute("stroke").CssText); } [Test] public void PresAttUpdating() { SvgStyleableElement elm = Util.GetXmlElement("<title fill='black' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); + Assert.AreEqual(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); elm.SetAttribute("fill", "red"); - Assertion.AssertEquals(CssValue.GetCssValue("red", false).CssText, elm.GetPresentationAttribute("fill").CssText); + Assert.AreEqual(CssValue.GetCssValue("red", false).CssText, elm.GetPresentationAttribute("fill").CssText); } [Test] public void PresAttRemoving() { SvgStyleableElement elm = Util.GetXmlElement("<title fill='black' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); + Assert.AreEqual(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); elm.RemoveAttribute("fill"); - Assertion.AssertNull(elm.GetPresentationAttribute("fill")); + Assert.IsNull(elm.GetPresentationAttribute("fill")); } [Test] public void PresAttEmptying() { SvgStyleableElement elm = Util.GetXmlElement("<title fill='black' />", "", "title") as SvgStyleableElement; - Assertion.AssertEquals(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); + Assert.AreEqual(CssValue.GetCssValue("black", false).CssText, elm.GetPresentationAttribute("fill").CssText); elm.SetAttribute("fill", ""); - Assertion.AssertNull(elm.GetPresentationAttribute("fill")); + Assert.IsNull(elm.GetPresentationAttribute("fill")); } #endregion } |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:35
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorDom/SharpVectors/Dom/Events Modified Files: Event.cs MutationEvent.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: Event.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/Event.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Event.cs 19 Nov 2005 03:13:23 -0000 1.4 +++ Event.cs 20 Nov 2005 20:42:23 -0000 1.5 @@ -449,7 +449,7 @@ return; } - Assertion.Assert(false); + Assert.IsTrue(false); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent02"> @@ -470,12 +470,12 @@ } catch (EventException e) { - Assertion.Assert(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); + Assert.IsTrue(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); return; } - Assertion.Assert(false); + Assert.IsTrue(false); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent03"> @@ -496,12 +496,12 @@ } catch (EventException e) { - Assertion.Assert(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); + Assert.IsTrue(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); return; } - Assertion.Assert(false); + Assert.IsTrue(false); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent04"> @@ -522,12 +522,12 @@ } catch (EventException e) { - Assertion.Assert(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); + Assert.IsTrue(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); return; } - Assertion.Assert(false); + Assert.IsTrue(false); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent05"> @@ -548,12 +548,12 @@ } catch (EventException e) { - Assertion.Assert(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); + Assert.IsTrue(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); return; } - Assertion.Assert(false); + Assert.IsTrue(false); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent06"> @@ -574,12 +574,12 @@ } catch (EventException e) { - Assertion.Assert(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); + Assert.IsTrue(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); return; } - Assertion.Assert(false); + Assert.IsTrue(false); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent07"> @@ -601,12 +601,12 @@ } catch (EventException e) { - Assertion.Assert(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); + Assert.IsTrue(e.Code == EventExceptionCode.UnspecifiedEventTypeErr); return; } - Assertion.Assert("Didn't fail as expected", false); + Assert.IsTrue(false, "Didn't fail as expected"); } /// <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="dispatchEvent08"> @@ -762,7 +762,7 @@ { IDocument document = LoadDocument("hc_staff.xml"); IEvent @event = ((IDocumentEvent)document).CreateEvent("Events"); - Assertion.Assert(@event != null); + Assert.IsTrue(@event != null); @event.InitEvent("rotate", true, false); Assert.AreEqual("rotate", @event.Type); Assert.AreEqual(true, @event.Bubbles); @@ -779,7 +779,7 @@ { IDocument document = LoadDocument("hc_staff.xml"); IEvent @event = ((IDocumentEvent)document).CreateEvent("Events"); - Assertion.Assert(@event != null); + Assert.IsTrue(@event != null); @event.InitEvent("rotate", false, true); Assert.AreEqual(false, @event.Bubbles); Assert.AreEqual(true, @event.Cancelable); @@ -796,7 +796,7 @@ { IDocument document = LoadDocument("hc_staff.xml"); IEvent @event = ((IDocumentEvent)document).CreateEvent("Events"); - Assertion.Assert(@event != null); + Assert.IsTrue(@event != null); @event.InitEvent("rotate", true, true); Assert.AreEqual("rotate", @event.Type); Assert.AreEqual(true, @event.Bubbles); @@ -818,7 +818,7 @@ { IDocument document = LoadDocument("hc_staff.xml"); IEvent @event = ((IDocumentEvent)document).CreateEvent("MutationEvents"); - Assertion.Assert(@event != null); + Assert.IsTrue(@event != null); @event.InitEvent("rotate", true, false); Assert.AreEqual("rotate", @event.Type); Assert.AreEqual(true, @event.Bubbles); @@ -836,7 +836,7 @@ { IDocument document = LoadDocument("hc_staff.xml"); IEvent @event = ((IDocumentEvent)document).CreateEvent("MutationEvents"); - Assertion.Assert(@event != null); + Assert.IsTrue(@event != null); @event.InitEvent("rotate", false, true); Assert.AreEqual("rotate", @event.Type); Assert.AreEqual(false, @event.Bubbles); @@ -855,7 +855,7 @@ { IDocument document = LoadDocument("hc_staff.xml"); IEvent @event = ((IDocumentEvent)document).CreateEvent("MutationEvents"); - Assertion.Assert(@event != null); + Assert.IsTrue(@event != null); @event.InitEvent("rotate", true, true); Assert.AreEqual("rotate", @event.Type); Assert.AreEqual(true, @event.Bubbles); Index: MutationEvent.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorDom/SharpVectors/Dom/Events/MutationEvent.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MutationEvent.cs 23 Oct 2005 23:39:29 -0000 1.3 +++ MutationEvent.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -120,7 +120,7 @@ [TestFixture] public class MutationEventTests_DOMCharacterDataModified { - [Test] + [Ignore("Mutation Events Not Implemented")] public void CommentNodeCreation() { Document document = new Document(); |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:35
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Net Modified Files: DataWebRequestTests.cs ExtendedHttpWebRequestTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: ExtendedHttpWebRequestTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Net/ExtendedHttpWebRequestTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ExtendedHttpWebRequestTests.cs 10 May 2003 10:46:49 -0000 1.1 +++ ExtendedHttpWebRequestTests.cs 20 Nov 2005 20:42:24 -0000 1.2 @@ -10,7 +10,7 @@ [Test] public void TestRemoteGZip() { - SvgWindow wnd = new SvgWindow(100, 100); + SvgWindow wnd = new SvgWindow(100, 100, null); SvgDocument doc = new SvgDocument(wnd); doc.Load("http://www.sharpvectors.org/tests/gzip-test.svgz"); } @@ -20,7 +20,7 @@ public void TestLocalGZip() { - SvgWindow wnd = new SvgWindow(100, 100); + SvgWindow wnd = new SvgWindow(100, 100, null); SvgDocument doc = new SvgDocument(wnd); doc.Load("gzip-test.svgz"); } Index: DataWebRequestTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Net/DataWebRequestTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DataWebRequestTests.cs 10 May 2003 10:46:49 -0000 1.1 +++ DataWebRequestTests.cs 20 Nov 2005 20:42:24 -0000 1.2 @@ -27,14 +27,14 @@ { DataWebResponse response = getResponse("data:,A%20brief%20note"); - Assertion.AssertEquals("text/plain;charset=US-ASCII", response.ContentType); - Assertion.AssertEquals(Encoding.ASCII, response.ContentEncoding); + Assert.AreEqual("text/plain;charset=US-ASCII", response.ContentType); + Assert.AreEqual(Encoding.ASCII, response.ContentEncoding); Stream stream = response.GetResponseStream(); StreamReader sr = new StreamReader(stream, response.ContentEncoding); string content = sr.ReadToEnd(); - Assertion.AssertEquals("A brief note", content); + Assert.AreEqual("A brief note", content); } [Test] @@ -42,15 +42,15 @@ { DataWebResponse response = getResponse("data:text/plain;charset=iso-8859-7,%be%fg%be"); - Assertion.AssertEquals("text/plain;charset=iso-8859-7", response.ContentType); - Assertion.AssertEquals(Encoding.GetEncoding("iso-8859-7"), response.ContentEncoding); + Assert.AreEqual("text/plain;charset=iso-8859-7", response.ContentType); + Assert.AreEqual(Encoding.GetEncoding("iso-8859-7"), response.ContentEncoding); Stream stream = response.GetResponseStream(); StreamReader sr = new StreamReader(stream, response.ContentEncoding); string content = sr.ReadToEnd(); // TODO: Not sure how to test this - // Assertion.AssertEquals("", content); + // Assert.AreEqual("", content); } [Test] @@ -58,11 +58,11 @@ { DataWebResponse response = getResponse("data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz\n\tByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp\n\ta/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl\n\tZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis\n\tF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH\n\thhx4dbgYKAAA7"); - Assertion.AssertEquals("image/gif", response.ContentType); + Assert.AreEqual("image/gif", response.ContentType); Stream stream = response.GetResponseStream(); - Assertion.AssertEquals(273, stream.Length); + Assert.AreEqual(273, stream.Length); } } } |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:35
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi Modified Files: GdiRendererTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: GdiRendererTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/GdiRendererTests.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- GdiRendererTests.cs 15 Jun 2003 22:29:18 -0000 1.9 +++ GdiRendererTests.cs 20 Nov 2005 20:42:24 -0000 1.10 @@ -1,174 +1 @@ -using System; using System.Drawing; using System.IO; -using NUnit.Framework; using SharpVectors.Dom.Svg; using SharpVectors.Renderer.Gdi; using SharpVectors.UnitTests.Renderer; -using System.Windows.Forms; -namespace SharpVectors.UnitTests.Renderer { [TestFixture] public class GdiRendererTests { #region Fields private static string baseDir; private static SvgWindow window; private static GdiRenderer renderer; private static BitmapComparator comparator; #endregion - #region Static Constructor static GdiRendererTests() { // init baseDir (relative to current directory) baseDir = @"Renderer.Gdi\"; } #endregion - [SetUp] - public void SetUp() - { - // create a BitmapComparator comparator = new BitmapComparator(); - // create an SVGWindow and an associated GdiRenderer renderer = new GdiRenderer(); window = new SvgWindow(75,75, renderer); } - - #region Tests [Test] public void TestCircleFill() { Assertion.Assert(CompareImages("circleFill.svg")); } [Test] public void TestCircleFillStroke() { Assertion.Assert(CompareImages("circleFillStroke.svg")); } [Test] public void TestCircleStroke() { Assertion.Assert(CompareImages("circleStroke.svg")); } [Test] public void TestEllipseFill() { Assertion.Assert(CompareImages("ellipseFill.svg")); } [Test] public void TestEllipseFillStroke() { Assertion.Assert(CompareImages("ellipseFillStroke.svg")); } [Test] public void TestEllipseStroke() { Assertion.Assert(CompareImages("ellipseStroke.svg")); } [Test] public void TestLinearGradient() { Assertion.Assert(CompareImages("lineargradient.svg")); } [Test] public void TestLinearGradient2() { Assertion.Assert(CompareImages("lineargradient2.svg")); } [Test] public void TestImageSvg() { Assertion.Assert(CompareImages("image-svg.svg")); } [Test] public void TestImagePng() { Assertion.Assert(CompareImages("image-png.svg")); } - - [Test] - public void TestLineStroke() - { - Assertion.Assert(CompareImages("lineStroke.svg")); - } - - [Test] public void TestMarkerLine() - { - Assertion.Assert("Marker - Line", CompareImages("marker-line.svg")); - } - [Test] public void TestMarkerPath() - { - Assertion.Assert("Marker - Path", CompareImages("marker-path.svg")); - } - [Test] public void TestMarkerPolygon() - { - Assertion.Assert("Marker - Polygon", CompareImages("marker-polygon.svg")); - } - - [Test] public void TestMarkerPolyline() - { - Assertion.Assert("Marker - Polyline", CompareImages("marker-polyline.svg")); - } - - [Test] - public void TestPathFill() - { - Assertion.Assert(CompareImages("pathFill.svg")); - } - - [Test] - public void TestPathFillStroke() - { - Assertion.Assert(CompareImages("pathFillStroke.svg")); - } - - [Test] - public void TestPathStroke() - { - Assertion.Assert(CompareImages("pathStroke.svg")); - } - - [Test] - public void TestPolygonFill() - { - Assertion.Assert(CompareImages("polygonFill.svg")); - } - - [Test] - public void TestPolygonFillStroke() - { - Assertion.Assert(CompareImages("polygonFillStroke.svg")); - } - - [Test] - public void TestPolygonStroke() - { - Assertion.Assert(CompareImages("polygonStroke.svg")); - } - - [Test] - public void TestPolylineFill() - { - Assertion.Assert(CompareImages("polylineFill.svg")); - } - - [Test] - public void TestPolylineFillStroke() - { - Assertion.Assert(CompareImages("polylineFillStroke.svg")); - } - - [Test] - public void TestPolylineStroke() - { - Assertion.Assert(CompareImages("polylineStroke.svg")); - } - - [Test] - public void TestRectangleFill() - { - Assertion.Assert(CompareImages("rectangleFill.svg")); - } - - [Test] - public void TestRectangleFillStroke() - { - Assertion.Assert(CompareImages("rectangleFillStroke.svg")); - } - - [Test] - public void TestRectangleStroke() - { - Assertion.Assert(CompareImages("rectangleStroke.svg")); - } - - [Test] - public void TestRoundedRectangleFill() - { - Assertion.Assert(CompareImages("roundedFill.svg")); - } - - [Test] - public void TestRectangleMatrix() { - Assertion.Assert(CompareImages("rectangleMatrix.svg")); - } - - [Test] - public void TestRectangleRotate() { - Assertion.Assert(CompareImages("rectangleRotate.svg")); - } - - [Test] - public void TestRectangleScale() { - Assertion.Assert(CompareImages("rectangleScale.svg")); - } - - [Test] - public void TestRectangleSkewX() { - Assertion.Assert(CompareImages("rectangleSkewX.svg")); - } - - [Test] - public void TestRectangleSkewY() { - Assertion.Assert(CompareImages("rectangleSkewY.svg")); - } - - [Test] - public void TestRectangleTranslate() { - Assertion.Assert(CompareImages("rectangleTranslate.svg")); - } - - [Test] - public void TestRoundedRectangleFillStroke() - { - Assertion.Assert(CompareImages("roundedFillStroke.svg")); - } - - [Test] - public void TestRoundedRectangleStroke() - { - Assertion.Assert(CompareImages("roundedStroke.svg")); - } - - [Test] - public void TestUse() - { - Assertion.Assert(CompareImages("use.svg")); - } - #endregion - #region data protocol tests - [Test] - public void DataProtocolTestInlineSvgImage() - { - Assertion.Assert(CompareImages("data-image.svg")); } - #endregion - - #region Support Methods - private bool CompareImages(string svgFile) { svgFile = Path.Combine(baseDir, svgFile); CompareUtil util = new CompareUtil(); SvgDocument doc = new SvgDocument(window); doc.Load(svgFile); return util.CompareImages(renderer.Render(doc), svgFile + ".png"); } #endregion - } -} +using System; using System.Drawing; using System.IO; using NUnit.Framework; using SharpVectors.Dom.Svg; using SharpVectors.Renderer.Gdi; using SharpVectors.UnitTests.Renderer; using System.Windows.Forms; namespace SharpVectors.UnitTests.Renderer { [TestFixture] public class GdiRendererTests { #region Fields private static string baseDir; private static SvgWindow window; private static GdiRenderer renderer; private static BitmapComparator comparator; #endregion #region Static Constructor static GdiRendererTests() { // init baseDir (relative to current directory) baseDir = @"Renderer.Gdi\"; } #endregion [SetUp] public void SetUp() { // create a BitmapComparator comparator = new BitmapComparator(); // create an SVGWindow and an associated GdiRenderer renderer = new GdiRenderer(); window = new SvgWindow(75,75, renderer); } #region Tests [Test] public void TestCircleFill() { Assert.IsTrue(CompareImages("circleFill.svg")); } [Test] public void TestCircleFillStroke() { Assert.IsTrue(CompareImages("circleFillStroke.svg")); } [Test] public void TestCircleStroke() { Assert.IsTrue(CompareImages("circleStroke.svg")); } [Test] public void TestEllipseFill() { Assert.IsTrue(CompareImages("ellipseFill.svg")); } [Test] public void TestEllipseFillStroke() { Assert.IsTrue(CompareImages("ellipseFillStroke.svg")); } [Test] public void TestEllipseStroke() { Assert.IsTrue(CompareImages("ellipseStroke.svg")); } [Test] public void TestLinearGradient() { Assert.IsTrue(CompareImages("lineargradient.svg")); } [Test] public void TestLinearGradient2() { Assert.IsTrue(CompareImages("lineargradient2.svg")); } [Test] public void TestImageSvg() { Assert.IsTrue(CompareImages("image-svg.svg")); } [Test] public void TestImagePng() { Assert.IsTrue(CompareImages("image-png.svg")); } [Test] public void TestLineStroke() { Assert.IsTrue(CompareImages("lineStroke.svg")); } [Test] public void TestMarkerLine() { Assert.IsTrue(CompareImages("marker-line.svg"), "Marker - Line"); } [Test] public void TestMarkerPath() { Assert.IsTrue(CompareImages("marker-path.svg"), "Marker - Path"); } [Test] public void TestMarkerPolygon() { Assert.IsTrue(CompareImages("marker-polygon.svg"), "Marker - Polygon"); } [Test] public void TestMarkerPolyline() { Assert.IsTrue(CompareImages("marker-polyline.svg"), "Marker - Polyline"); } [Test] public void TestPathFill() { Assert.IsTrue(CompareImages("pathFill.svg")); } [Test] public void TestPathFillStroke() { Assert.IsTrue(CompareImages("pathFillStroke.svg")); } [Test] public void TestPathStroke() { Assert.IsTrue(CompareImages("pathStroke.svg")); } [Test] public void TestPolygonFill() { Assert.IsTrue(CompareImages("polygonFill.svg")); } [Test] public void TestPolygonFillStroke() { Assert.IsTrue(CompareImages("polygonFillStroke.svg")); } [Test] public void TestPolygonStroke() { Assert.IsTrue(CompareImages("polygonStroke.svg")); } [Test] public void TestPolylineFill() { Assert.IsTrue(CompareImages("polylineFill.svg")); } [Test] public void TestPolylineFillStroke() { Assert.IsTrue(CompareImages("polylineFillStroke.svg")); } [Test] public void TestPolylineStroke() { Assert.IsTrue(CompareImages("polylineStroke.svg")); } [Test] public void TestRectangleFill() { Assert.IsTrue(CompareImages("rectangleFill.svg")); } [Test] public void TestRectangleFillStroke() { Assert.IsTrue(CompareImages("rectangleFillStroke.svg")); } [Test] public void TestRectangleStroke() { Assert.IsTrue(CompareImages("rectangleStroke.svg")); } [Test] public void TestRoundedRectangleFill() { Assert.IsTrue(CompareImages("roundedFill.svg")); } [Test] public void TestRectangleMatrix() { Assert.IsTrue(CompareImages("rectangleMatrix.svg")); } [Test] public void TestRectangleRotate() { Assert.IsTrue(CompareImages("rectangleRotate.svg")); } [Test] public void TestRectangleScale() { Assert.IsTrue(CompareImages("rectangleScale.svg")); } [Test] public void TestRectangleSkewX() { Assert.IsTrue(CompareImages("rectangleSkewX.svg")); } [Test] public void TestRectangleSkewY() { Assert.IsTrue(CompareImages("rectangleSkewY.svg")); } [Test] public void TestRectangleTranslate() { Assert.IsTrue(CompareImages("rectangleTranslate.svg")); } [Test] public void TestRoundedRectangleFillStroke() { Assert.IsTrue(CompareImages("roundedFillStroke.svg")); } [Test] public void TestRoundedRectangleStroke() { Assert.IsTrue(CompareImages("roundedStroke.svg")); } [Test] public void TestUse() { Assert.IsTrue(CompareImages("use.svg")); } #endregion #region data protocol tests [Test] public void DataProtocolTestInlineSvgImage() { Assert.IsTrue(CompareImages("data-image.svg")); } #endregion #region Support Methods private bool CompareImages(string svgFile) { svgFile = Path.Combine(baseDir, svgFile); CompareUtil util = new CompareUtil(); SvgDocument doc = new SvgDocument(window); doc.Load(svgFile); return util.CompareImages(renderer.Render(doc), svgFile + ".png"); } #endregion } } \ No newline at end of file |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:35
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Paths In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Paths Modified Files: SvgPathSegListTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgPathSegListTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Paths/SvgPathSegListTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SvgPathSegListTests.cs 23 Apr 2003 22:41:30 -0000 1.5 +++ SvgPathSegListTests.cs 20 Nov 2005 20:42:24 -0000 1.6 @@ -16,16 +16,16 @@ public void ParseTest1() { SvgPathSegList list = new SvgPathSegList("M10, 30L70-20,23 -12L23 34z", false); - Assertion.AssertEquals(5, list.NumberOfItems); - Assertion.AssertEquals("M", list[0].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(10,30), ((SvgPathSegMovetoAbs)list[0]).AbsXY); - Assertion.AssertEquals("L", list[1].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(70,-20), ((SvgPathSegLinetoAbs)list[1]).AbsXY); - Assertion.AssertEquals("L", list[2].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(23,-12), ((SvgPathSegLinetoAbs)list[2]).AbsXY); - Assertion.AssertEquals("L", list[3].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(23,34), ((SvgPathSegLinetoAbs)list[3]).AbsXY); - Assertion.AssertEquals("z", list[4].PathSegTypeAsLetter); + Assert.AreEqual(5, list.NumberOfItems); + Assert.AreEqual("M", list[0].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(10,30), ((SvgPathSegMovetoAbs)list[0]).AbsXY); + Assert.AreEqual("L", list[1].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(70,-20), ((SvgPathSegLinetoAbs)list[1]).AbsXY); + Assert.AreEqual("L", list[2].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(23,-12), ((SvgPathSegLinetoAbs)list[2]).AbsXY); + Assert.AreEqual("L", list[3].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(23,34), ((SvgPathSegLinetoAbs)list[3]).AbsXY); + Assert.AreEqual("z", list[4].PathSegTypeAsLetter); } /// <summary> @@ -35,24 +35,24 @@ public void TestMultipleMovetosAbs() { SvgPathSegList list = new SvgPathSegList("M10, 30 70-20,23 -12", false); - Assertion.AssertEquals(3, list.NumberOfItems); - Assertion.AssertEquals("M", list[0].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(10,30), ((SvgPathSegMovetoAbs)list[0]).AbsXY); - Assertion.AssertEquals("L", list[1].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(70,-20), ((SvgPathSegLinetoAbs)list[1]).AbsXY); - Assertion.AssertEquals("L", list[2].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(23,-12), ((SvgPathSegLinetoAbs)list[2]).AbsXY); + Assert.AreEqual(3, list.NumberOfItems); + Assert.AreEqual("M", list[0].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(10,30), ((SvgPathSegMovetoAbs)list[0]).AbsXY); + Assert.AreEqual("L", list[1].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(70,-20), ((SvgPathSegLinetoAbs)list[1]).AbsXY); + Assert.AreEqual("L", list[2].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(23,-12), ((SvgPathSegLinetoAbs)list[2]).AbsXY); } [Test] public void TestMultipleMovetosRel() { SvgPathSegList list = new SvgPathSegList("m10,30 20,20", false); - Assertion.AssertEquals(2, list.NumberOfItems); - Assertion.AssertEquals("m", list[0].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(10,30), ((SvgPathSegMovetoRel)list[0]).AbsXY); - Assertion.AssertEquals("l", list[1].PathSegTypeAsLetter); - Assertion.AssertEquals(new PointF(30,50), ((SvgPathSegLinetoRel)list[1]).AbsXY); + Assert.AreEqual(2, list.NumberOfItems); + Assert.AreEqual("m", list[0].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(10,30), ((SvgPathSegMovetoRel)list[0]).AbsXY); + Assert.AreEqual("l", list[1].PathSegTypeAsLetter); + Assert.AreEqual(new PointF(30,50), ((SvgPathSegLinetoRel)list[1]).AbsXY); } #endregion @@ -62,11 +62,11 @@ { SvgPathSegList list = new SvgPathSegList("M10,10L100,10,100,100,10,100z", false); - Assertion.AssertEquals(270, ((SvgPathSeg)list[1]).StartAngle); - Assertion.AssertEquals(90, ((SvgPathSeg)list[1]).EndAngle); + Assert.AreEqual(270, ((SvgPathSeg)list[1]).StartAngle); + Assert.AreEqual(90, ((SvgPathSeg)list[1]).EndAngle); - Assertion.AssertEquals(180, ((SvgPathSeg)list[4]).StartAngle); - Assertion.AssertEquals(0, ((SvgPathSeg)list[4]).EndAngle); + Assert.AreEqual(180, ((SvgPathSeg)list[4]).StartAngle); + Assert.AreEqual(0, ((SvgPathSeg)list[4]).EndAngle); } private bool floatsTest(string label, float f1, float f2) @@ -75,7 +75,7 @@ if(!ret) { // this will allways fail giving a nice output message - Assertion.AssertEquals(label, f1, f2); + Assert.AreEqual(f1, f2, label); } return ret; } @@ -165,7 +165,7 @@ public void TestEmptyList() { SvgPathSegList list = getEmptyList(); - Assertion.AssertEquals(0, list.NumberOfItems); + Assert.AreEqual(0, list.NumberOfItems); } @@ -174,8 +174,8 @@ { SvgPathSegList list = getEmptyList(); list.AppendItem(getLineto()); - Assertion.AssertEquals(1, list.NumberOfItems); - Assertion.AssertEquals(SvgPathSegType.LineToAbs, list[0].PathSegType); + Assert.AreEqual(1, list.NumberOfItems); + Assert.AreEqual(SvgPathSegType.LineToAbs, list[0].PathSegType); } [Test] @@ -183,10 +183,10 @@ { SvgPathSegList list = getNonEmptyList(); list.RemoveItem(1); - Assertion.AssertEquals(2, list.NumberOfItems); - Assertion.AssertEquals(0, ((SvgPathSeg)list[0]).Index); - Assertion.AssertEquals(1, ((SvgPathSeg)list[1]).Index); - Assertion.AssertEquals(SvgPathSegType.LineToRel, list[1].PathSegType); + Assert.AreEqual(2, list.NumberOfItems); + Assert.AreEqual(0, ((SvgPathSeg)list[0]).Index); + Assert.AreEqual(1, ((SvgPathSeg)list[1]).Index); + Assert.AreEqual(SvgPathSegType.LineToRel, list[1].PathSegType); } [Test] @@ -194,8 +194,8 @@ { SvgPathSegList list = getNonEmptyList(); list.ReplaceItem(getLineto(), 0); - Assertion.AssertEquals(3, list.NumberOfItems); - Assertion.AssertEquals(SvgPathSegType.LineToAbs, list[0].PathSegType); + Assert.AreEqual(3, list.NumberOfItems); + Assert.AreEqual(SvgPathSegType.LineToAbs, list[0].PathSegType); } [Test] @@ -203,14 +203,14 @@ { SvgPathSegList list = getNonEmptyList(); list.InsertItemBefore(getLineto(), 1); - Assertion.AssertEquals(4, list.NumberOfItems); + Assert.AreEqual(4, list.NumberOfItems); - Assertion.AssertEquals(1, ((SvgPathSeg)list[1]).Index); - Assertion.AssertEquals(2, ((SvgPathSeg)list[2]).Index); - Assertion.AssertEquals(SvgPathSegType.MoveToAbs, list[0].PathSegType); - Assertion.AssertEquals(SvgPathSegType.LineToAbs, list[1].PathSegType); - Assertion.AssertEquals(SvgPathSegType.LineToAbs, list[2].PathSegType); - Assertion.AssertEquals(SvgPathSegType.LineToRel, list[3].PathSegType); + Assert.AreEqual(1, ((SvgPathSeg)list[1]).Index); + Assert.AreEqual(2, ((SvgPathSeg)list[2]).Index); + Assert.AreEqual(SvgPathSegType.MoveToAbs, list[0].PathSegType); + Assert.AreEqual(SvgPathSegType.LineToAbs, list[1].PathSegType); + Assert.AreEqual(SvgPathSegType.LineToAbs, list[2].PathSegType); + Assert.AreEqual(SvgPathSegType.LineToRel, list[3].PathSegType); } [Test] @@ -219,9 +219,9 @@ SvgPathSegList list = getNonEmptyList(); list.Initialize(getLineto()); - Assertion.AssertEquals(1, list.NumberOfItems); - Assertion.AssertEquals(SvgPathSegType.LineToAbs, list[0].PathSegType); - Assertion.AssertEquals(0, ((SvgPathSeg)list[0]).Index); + Assert.AreEqual(1, list.NumberOfItems); + Assert.AreEqual(SvgPathSegType.LineToAbs, list[0].PathSegType); + Assert.AreEqual(0, ((SvgPathSeg)list[0]).Index); } [Test] @@ -249,7 +249,7 @@ string d = "M1,2L3,4l5,6H7h8V9v0zC1,2,3,4,5,6c7,8,9,0,1,2S3,4,5,6s7,8,9,0Q1,2,3,4q5,6,7,8T9,0t1,2A3,4,5,1,0,8,9a0,1,2,0,1,5,6"; SvgPathSegList list = new SvgPathSegList(d, false); - Assertion.AssertEquals(d, list.PathText); + Assert.AreEqual(d, list.PathText); } #endregion |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:35
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Gradients and Patterns In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Gradients and Patterns Modified Files: SvgGradientElementTests.cs SvgLinearGradientElementTests.cs SvgPatternElementTests.cs SvgRadialGradientElementTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgRadialGradientElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Gradients and Patterns/SvgRadialGradientElementTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgRadialGradientElementTests.cs 23 Apr 2003 22:41:28 -0000 1.2 +++ SvgRadialGradientElementTests.cs 20 Nov 2005 20:42:24 -0000 1.3 @@ -26,11 +26,11 @@ { SvgRadialGradientElement elm = Util.GetXmlElement("<radialGradient cx='1' cy='2' r='3' fx='4' fy='5' />", "", "radialGradient") as SvgRadialGradientElement; - Assertion.AssertEquals("cx", 1, elm.Cx.AnimVal.Value); - Assertion.AssertEquals("cy", 2, elm.Cy.AnimVal.Value); - Assertion.AssertEquals("r", 3, elm.R.AnimVal.Value); - Assertion.AssertEquals("fx", 4, elm.Fx.AnimVal.Value); - Assertion.AssertEquals("fy", 5, elm.Fy.AnimVal.Value); + Assert.AreEqual(1, elm.Cx.AnimVal.Value, "cx"); + Assert.AreEqual(2, elm.Cy.AnimVal.Value, "cy"); + Assert.AreEqual(3, elm.R.AnimVal.Value, "r"); + Assert.AreEqual(4, elm.Fx.AnimVal.Value, "fx"); + Assert.AreEqual(5, elm.Fy.AnimVal.Value, "fy"); } [Test] @@ -38,8 +38,8 @@ { SvgRadialGradientElement elm = Util.GetXmlElement("<radialGradient fy='5' />", "", "radialGradient") as SvgRadialGradientElement; - Assertion.AssertEquals("fx", 5, elm.Fx.AnimVal.Value); - Assertion.AssertEquals("fy", 5, elm.Fy.AnimVal.Value); + Assert.AreEqual(5, elm.Fx.AnimVal.Value, "fx"); + Assert.AreEqual(5, elm.Fy.AnimVal.Value, "fy"); } } Index: SvgPatternElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Gradients and Patterns/SvgPatternElementTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgPatternElementTests.cs 23 Apr 2003 22:41:28 -0000 1.3 +++ SvgPatternElementTests.cs 20 Nov 2005 20:42:24 -0000 1.4 @@ -27,58 +27,60 @@ { SvgPatternElement elm = Util.GetXmlElement("<pattern x='1' y='2' width='3' height='4' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals("x", 1, elm.X.AnimVal.Value); - Assertion.AssertEquals("y", 2, elm.Y.AnimVal.Value); - Assertion.AssertEquals("width", 3, elm.Width.AnimVal.Value); - Assertion.AssertEquals("height", 4, elm.Height.AnimVal.Value); + Assert.AreEqual(1, elm.X.AnimVal.Value, "x"); + Assert.AreEqual(2, elm.Y.AnimVal.Value, "y"); + Assert.AreEqual(3, elm.Width.AnimVal.Value, "width"); + Assert.AreEqual(4, elm.Height.AnimVal.Value,"height"); } [Test] public void TestPatternUnits() { SvgPatternElement elm = Util.GetXmlElement("<pattern patternUnits='userSpaceOnUse' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgUnitType.UserSpaceOnUse, elm.PatternUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.UserSpaceOnUse, elm.PatternUnits.AnimVal); elm = Util.GetXmlElement("<pattern patternUnits='objectBoundingBox' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgUnitType.ObjectBoundingBox, elm.PatternUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.ObjectBoundingBox, elm.PatternUnits.AnimVal); elm = Util.GetXmlElement("<pattern />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgUnitType.ObjectBoundingBox, elm.PatternUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.ObjectBoundingBox, elm.PatternUnits.AnimVal); } [Test] public void TestPatternContentUnits() { SvgPatternElement elm = Util.GetXmlElement("<pattern patternContentUnits='userSpaceOnUse' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgUnitType.UserSpaceOnUse, elm.PatternContentUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.UserSpaceOnUse, elm.PatternContentUnits.AnimVal); elm = Util.GetXmlElement("<pattern patternContentUnits='objectBoundingBox' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgUnitType.ObjectBoundingBox, elm.PatternContentUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.ObjectBoundingBox, elm.PatternContentUnits.AnimVal); elm = Util.GetXmlElement("<pattern />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgUnitType.UserSpaceOnUse, elm.PatternContentUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.UserSpaceOnUse, elm.PatternContentUnits.AnimVal); } [Test] public void TestPatternTransform() { SvgPatternElement elm = Util.GetXmlElement("<pattern patternTransform='translate(1,1) rotate(34)' />", "", "pattern") as SvgPatternElement; - Assertion.Assert(elm.PatternTransform is ISvgAnimatedTransformList); - Assertion.AssertEquals(2, elm.PatternTransform.AnimVal.NumberOfItems); + ISvgAnimatedTransformList satl = elm.PatternTransform as ISvgAnimatedTransformList; + Assert.IsNotNull(satl); + Assert.AreEqual(2, elm.PatternTransform.AnimVal.NumberOfItems); elm = Util.GetXmlElement("<pattern />", "", "pattern") as SvgPatternElement; - Assertion.Assert(elm.PatternTransform is ISvgAnimatedTransformList); - Assertion.AssertEquals(0, elm.PatternTransform.AnimVal.NumberOfItems); + satl = elm.PatternTransform as ISvgAnimatedTransformList; + Assert.IsNotNull(satl); + Assert.AreEqual(0, elm.PatternTransform.AnimVal.NumberOfItems); } [Test] public void TestHref() { SvgPatternElement elm = Util.GetXmlElement("<pattern xlink:href='kalle.svg#someOtherPattern' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals("kalle.svg#someOtherPattern", elm.Href.AnimVal); + Assert.AreEqual("kalle.svg#someOtherPattern", elm.Href.AnimVal); elm = Util.GetXmlElement("<pattern />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals("", elm.Href.AnimVal); + Assert.AreEqual("", elm.Href.AnimVal); } [Test] @@ -86,17 +88,17 @@ { SvgPatternElement elm = Util.GetXmlElement("<pattern viewBox='1 2 3 4' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(1, elm.ViewBox.AnimVal.X); - Assertion.AssertEquals(2, elm.ViewBox.AnimVal.Y); - Assertion.AssertEquals(3, elm.ViewBox.AnimVal.Width); - Assertion.AssertEquals(4, elm.ViewBox.AnimVal.Height); + Assert.AreEqual(1, elm.ViewBox.AnimVal.X); + Assert.AreEqual(2, elm.ViewBox.AnimVal.Y); + Assert.AreEqual(3, elm.ViewBox.AnimVal.Width); + Assert.AreEqual(4, elm.ViewBox.AnimVal.Height); elm = Util.GetXmlElement("<pattern />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(0, elm.ViewBox.AnimVal.X); - Assertion.AssertEquals(0, elm.ViewBox.AnimVal.Y); - Assertion.AssertEquals(0, elm.ViewBox.AnimVal.Width); - Assertion.AssertEquals(0, elm.ViewBox.AnimVal.Height); + Assert.AreEqual(0, elm.ViewBox.AnimVal.X); + Assert.AreEqual(0, elm.ViewBox.AnimVal.Y); + Assert.AreEqual(0, elm.ViewBox.AnimVal.Width); + Assert.AreEqual(0, elm.ViewBox.AnimVal.Height); } [Test] @@ -104,13 +106,13 @@ { SvgPatternElement elm = Util.GetXmlElement("<pattern preserveAspectRatio='xMidYMin slice' />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgPreserveAspectRatioType.XMidYMin, elm.PreserveAspectRatio.AnimVal.Align); - Assertion.AssertEquals(SvgMeetOrSlice.Slice, elm.PreserveAspectRatio.AnimVal.MeetOrSlice); + Assert.AreEqual(SvgPreserveAspectRatioType.XMidYMin, elm.PreserveAspectRatio.AnimVal.Align); + Assert.AreEqual(SvgMeetOrSlice.Slice, elm.PreserveAspectRatio.AnimVal.MeetOrSlice); elm = Util.GetXmlElement("<pattern />", "", "pattern") as SvgPatternElement; - Assertion.AssertEquals(SvgPreserveAspectRatioType.XMidYMid, elm.PreserveAspectRatio.AnimVal.Align); - Assertion.AssertEquals(SvgMeetOrSlice.Meet, elm.PreserveAspectRatio.AnimVal.MeetOrSlice); + Assert.AreEqual(SvgPreserveAspectRatioType.XMidYMid, elm.PreserveAspectRatio.AnimVal.Align); + Assert.AreEqual(SvgMeetOrSlice.Meet, elm.PreserveAspectRatio.AnimVal.MeetOrSlice); } } } Index: SvgGradientElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Gradients and Patterns/SvgGradientElementTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgGradientElementTests.cs 23 Apr 2003 22:41:28 -0000 1.2 +++ SvgGradientElementTests.cs 20 Nov 2005 20:42:24 -0000 1.3 @@ -14,25 +14,27 @@ public void TestGradientUnits() { SvgGradientElement elm = Util.GetXmlElement("<linearGradient gradientUnits='userSpaceOnUse' />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgUnitType.UserSpaceOnUse, elm.GradientUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.UserSpaceOnUse, elm.GradientUnits.AnimVal); elm = Util.GetXmlElement("<linearGradient gradientUnits='objectBoundingBox' />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgUnitType.ObjectBoundingBox, elm.GradientUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.ObjectBoundingBox, elm.GradientUnits.AnimVal); elm = Util.GetXmlElement("<linearGradient />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgUnitType.ObjectBoundingBox, elm.GradientUnits.AnimVal); + Assert.AreEqual((ushort)SvgUnitType.ObjectBoundingBox, elm.GradientUnits.AnimVal); } [Test] public void TestGradientTransform() { SvgGradientElement elm = Util.GetXmlElement("<linearGradient gradientTransform='translate(1,1) rotate(34)' />", "", "linearGradient") as SvgGradientElement; - Assertion.Assert(elm.GradientTransform is ISvgAnimatedTransformList); - Assertion.AssertEquals(2, elm.GradientTransform.AnimVal.NumberOfItems); + ISvgAnimatedTransformList satl = elm.GradientTransform as ISvgAnimatedTransformList; + Assert.IsNotNull(satl); + Assert.AreEqual(2, elm.GradientTransform.AnimVal.NumberOfItems); elm = Util.GetXmlElement("<linearGradient />", "", "linearGradient") as SvgGradientElement; - Assertion.Assert(elm.GradientTransform is ISvgAnimatedTransformList); - Assertion.AssertEquals(0, elm.GradientTransform.AnimVal.NumberOfItems); + satl = elm.GradientTransform as ISvgAnimatedTransformList; + Assert.IsNotNull(satl); + Assert.AreEqual(0, elm.GradientTransform.AnimVal.NumberOfItems); } @@ -40,36 +42,36 @@ public void TestSpreadMethod() { SvgGradientElement elm = Util.GetXmlElement("<linearGradient spreadMethod='reflect' />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgSpreadMethod.Reflect, elm.SpreadMethod.AnimVal); + Assert.AreEqual((ushort)SvgSpreadMethod.Reflect, elm.SpreadMethod.AnimVal); elm = Util.GetXmlElement("<linearGradient spreadMethod='repeat' />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgSpreadMethod.Repeat, elm.SpreadMethod.AnimVal); + Assert.AreEqual((ushort)SvgSpreadMethod.Repeat, elm.SpreadMethod.AnimVal); elm = Util.GetXmlElement("<linearGradient spreadMethod='pad' />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgSpreadMethod.Pad, elm.SpreadMethod.AnimVal); + Assert.AreEqual((ushort)SvgSpreadMethod.Pad, elm.SpreadMethod.AnimVal); elm = Util.GetXmlElement("<linearGradient />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(SvgSpreadMethod.Pad, elm.SpreadMethod.AnimVal); + Assert.AreEqual((ushort)SvgSpreadMethod.Pad, elm.SpreadMethod.AnimVal); } [Test] public void TestHref() { SvgGradientElement elm = Util.GetXmlElement("<linearGradient xlink:href='kalle.svg#someOtherGradient' />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals("kalle.svg#someOtherGradient", elm.Href.AnimVal); + Assert.AreEqual("kalle.svg#someOtherGradient", elm.Href.AnimVal); elm = Util.GetXmlElement("<linearGradient />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals("", elm.Href.AnimVal); + Assert.AreEqual("", elm.Href.AnimVal); } [Test] public void TestStopsCount() { SvgGradientElement elm = Util.GetXmlElement("<linearGradient><stop offset='5%' stop-color='blue' /><stop offset='10%' stop-color='red' /></linearGradient>", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(2, elm.Stops.Count); + Assert.AreEqual(2, elm.Stops.Count); elm = Util.GetXmlElement("<linearGradient />", "", "linearGradient") as SvgGradientElement; - Assertion.AssertEquals(0, elm.Stops.Count); + Assert.AreEqual(0, elm.Stops.Count); } } } Index: SvgLinearGradientElementTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Gradients and Patterns/SvgLinearGradientElementTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SvgLinearGradientElementTests.cs 23 Apr 2003 22:41:28 -0000 1.2 +++ SvgLinearGradientElementTests.cs 20 Nov 2005 20:42:24 -0000 1.3 @@ -27,10 +27,10 @@ { SvgLinearGradientElement elm = Util.GetXmlElement("<linearGradient x1='1' y1='2' x2='3' y2='4' />", "", "linearGradient") as SvgLinearGradientElement; - Assertion.AssertEquals("x1", 1, elm.X1.AnimVal.Value); - Assertion.AssertEquals("y1", 2, elm.Y1.AnimVal.Value); - Assertion.AssertEquals("x2", 3, elm.X2.AnimVal.Value); - Assertion.AssertEquals("y2", 4, elm.Y2.AnimVal.Value); + Assert.AreEqual(1, elm.X1.AnimVal.Value, "x1"); + Assert.AreEqual(2, elm.Y1.AnimVal.Value, "y1"); + Assert.AreEqual(3, elm.X2.AnimVal.Value, "x2"); + Assert.AreEqual(4, elm.Y2.AnimVal.Value, "y2"); } } |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:35
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Dom/Svg Modified Files: CssPropertyProfileTests.cs CssSelectorsTests.cs SvgWindowTest.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: CssSelectorsTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/CssSelectorsTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CssSelectorsTests.cs 23 Apr 2003 22:41:11 -0000 1.2 +++ CssSelectorsTests.cs 20 Nov 2005 20:42:23 -0000 1.3 @@ -37,97 +37,97 @@ [Test] public void TestStyleSheetLength() { - Assertion.AssertEquals(1, doc.StyleSheets.Length); + Assert.AreEqual(1, doc.StyleSheets.Length); } [Test] public void TestPropertyAttribute() { - Assertion.AssertEquals(correctValue, getFill(1)); + Assert.AreEqual(correctValue, getFill(1)); } [Test] public void TestId() { - Assertion.AssertEquals(correctValue, getFill(2)); + Assert.AreEqual(correctValue, getFill(2)); } [Test] public void TestType() { - Assertion.AssertEquals(correctValue, getFill(3)); + Assert.AreEqual(correctValue, getFill(3)); } [Test] public void TestClass() { - Assertion.AssertEquals(correctValue, getFill(4)); + Assert.AreEqual(correctValue, getFill(4)); } [Test] public void TestClass2() { - Assertion.AssertEquals(correctValue, getFill(5)); + Assert.AreEqual(correctValue, getFill(5)); } [Test] public void TestUniversal() { - Assertion.AssertEquals(correctValue, getFill(6)); + Assert.AreEqual(correctValue, getFill(6)); } [Test] public void TestAttribute() { - Assertion.AssertEquals(correctValue, getFill(7)); + Assert.AreEqual(correctValue, getFill(7)); } [Test] public void TestAttributeEquals() { - Assertion.AssertEquals(correctValue, getFill(8)); + Assert.AreEqual(correctValue, getFill(8)); } [Test] public void TestAttributeStartsWith() { - Assertion.AssertEquals(correctValue, getFill(9)); + Assert.AreEqual(correctValue, getFill(9)); } [Test] public void TestAttributeEndsWith() { - Assertion.AssertEquals(correctValue, getFill(10)); + Assert.AreEqual(correctValue, getFill(10)); } [Test] public void TestNotType() { - Assertion.AssertEquals(correctValue, getFill(11)); + Assert.AreEqual(correctValue, getFill(11)); } [Test] public void TestNotId() { - Assertion.AssertEquals(correctValue, getFill(12)); + Assert.AreEqual(correctValue, getFill(12)); } [Test] public void TestNotClass() { - Assertion.AssertEquals(correctValue, getFill(13)); + Assert.AreEqual(correctValue, getFill(13)); } [Test] public void TestLang() { - Assertion.AssertEquals(correctValue, getFill(14)); + Assert.AreEqual(correctValue, getFill(14)); } [Test] public void TestEmpty() { - Assertion.AssertEquals(correctValue, getFill(15)); + Assert.AreEqual(correctValue, getFill(15)); } } } Index: CssPropertyProfileTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/CssPropertyProfileTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CssPropertyProfileTests.cs 23 Apr 2003 22:41:09 -0000 1.2 +++ CssPropertyProfileTests.cs 20 Nov 2005 20:42:23 -0000 1.3 @@ -12,7 +12,7 @@ { SvgWindow wnd = new SvgWindow(100, 100, null); SvgDocument doc = new SvgDocument(wnd); - Assertion.AssertEquals(61, doc.CssPropertyProfile.Length); + Assert.AreEqual(61, doc.CssPropertyProfile.Length); } } } Index: SvgWindowTest.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/SvgWindowTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SvgWindowTest.cs 18 Feb 2003 22:05:10 -0000 1.1 +++ SvgWindowTest.cs 20 Nov 2005 20:42:23 -0000 1.2 @@ -2,6 +2,9 @@ /* * $Header$ * $Log$ + * Revision 1.2 2005/11/20 20:42:23 jeffrafter + * Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes + * * Revision 1.1 2003/02/18 22:05:10 nikgus * no message * @@ -36,8 +39,8 @@ public void TestConstructor1() { SvgWindow window = new SvgWindow( 1,2 ); - Assertion.AssertEquals("Width",1,window.InnerWidth); - Assertion.AssertEquals("Height",2,window.InnerHeight); + Assert.AreEqual("Width",1,window.InnerWidth); + Assert.AreEqual("Height",2,window.InnerHeight); } @@ -47,8 +50,8 @@ System.Windows.Forms.GroupBox control = new System.Windows.Forms.GroupBox(); SvgWindow window = new SvgWindow( 1, 2, control ); - Assertion.AssertEquals("Width",1,window.InnerWidth); - Assertion.AssertEquals("Height",2,window.InnerHeight); + Assert.AreEqual("Width",1,window.InnerWidth); + Assert.AreEqual("Height",2,window.InnerHeight); }*/ /* [ExpectedException(typeof(NullReferenceException))] |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:34
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure Modified Files: SvgDocument.cs SvgImageElement.cs SvgTransformableElement.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgDocument.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure/SvgDocument.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgDocument.cs 19 Nov 2005 03:13:23 -0000 1.3 +++ SvgDocument.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -245,7 +245,7 @@ } return; - LocalDtdXmlUrlResolver localDtdXmlUrlResolver = new LocalDtdXmlUrlResolver(); + /*LocalDtdXmlUrlResolver localDtdXmlUrlResolver = new LocalDtdXmlUrlResolver(); localDtdXmlUrlResolver.AddDtd("http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd", @"dtd\svg10.dtd"); localDtdXmlUrlResolver.AddDtd("http://www.w3.org/TR/SVG/DTD/svg10.dtd", @"dtd\svg10.dtd"); localDtdXmlUrlResolver.AddDtd("http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd", @"dtd\svg11-tiny.dtd"); @@ -260,7 +260,7 @@ valReader.XmlResolver = localDtdXmlUrlResolver; } - this.XmlResolver = localDtdXmlUrlResolver; + this.XmlResolver = localDtdXmlUrlResolver;*/ } /// <overloads> Index: SvgTransformableElement.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure/SvgTransformableElement.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgTransformableElement.cs 19 Nov 2005 03:13:23 -0000 1.3 +++ SvgTransformableElement.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -70,11 +70,6 @@ GraphicsPath gp = gdiPathElm.GetGraphicsPath(); SvgMatrix svgMatrix = (SvgMatrix)this.GetScreenCTM(); RectangleF bounds = gp.GetBounds(svgMatrix.ToMatrix()); - string strokeWidth = this.GetPropertyValue("stroke-width"); - if(strokeWidth.Length == 0) strokeWidth = "1px"; - SvgLength strokeWidthLength = new SvgLength(this, "stroke-width", SvgLengthDirection.Viewport, strokeWidth); - float sw = (float)strokeWidthLength.Value; - margin += sw; bounds = RectangleF.Inflate(bounds, margin, margin); return bounds; } @@ -249,7 +244,10 @@ //TODO this is still fairly experimental, a margin of 20 gives us some overlap for leeway //TODO in general, overlap is necessary to handle strokes, which are not covered in bbox, but are //TODO for rendering purposes (same with markers) - renderingNode.ScreenRegion = GetBRect(0); + string strokeWidth = this.GetPropertyValue("stroke-width"); + if(strokeWidth.Length == 0) strokeWidth = "1px"; + SvgLength strokeWidthLength = new SvgLength(this, "stroke-width", SvgLengthDirection.Viewport, strokeWidth); + renderingNode.ScreenRegion = GetBRect((float)strokeWidthLength.Value); } } @@ -259,15 +257,19 @@ { base.CssInvalidate(); + string strokeWidth = this.GetPropertyValue("stroke-width"); + if(strokeWidth.Length == 0) strokeWidth = "1px"; + SvgLength strokeWidthLength = new SvgLength(this, "stroke-width", SvgLengthDirection.Viewport, strokeWidth); + if (renderingNode != null) { // Quick-cache - renderingNode.ScreenRegion = GetBRect(0); + renderingNode.ScreenRegion = GetBRect((float)strokeWidthLength.Value); OwnerDocument.Window.Renderer.InvalidateRect(renderingNode.ScreenRegion); } else { - OwnerDocument.Window.Renderer.InvalidateRect(GetBRect(0)); + OwnerDocument.Window.Renderer.InvalidateRect(GetBRect((float)strokeWidthLength.Value)); } } Index: SvgImageElement.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure/SvgImageElement.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SvgImageElement.cs 6 Mar 2005 08:07:04 -0000 1.1 +++ SvgImageElement.cs 20 Nov 2005 20:42:23 -0000 1.2 @@ -323,13 +323,13 @@ doc.LoadXml(testData); SvgImageElement imgElm = doc.GetElementById("theImage") as SvgImageElement; - Assertion.AssertNotNull(imgElm); - Assertion.Assert("IsSvgImage", !imgElm.IsSvgImage); + Assert.IsNotNull(imgElm); + Assert.IsTrue(!imgElm.IsSvgImage, "IsSvgImage"); Bitmap bmp = imgElm.Bitmap; - Assertion.AssertEquals(48, bmp.Width); - Assertion.AssertEquals(48, bmp.Height); + Assert.AreEqual(48, bmp.Width); + Assert.AreEqual(48, bmp.Height); } } #endif |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:34
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/Paint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/Paint Modified Files: GdiSvgPaintTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: GdiSvgPaintTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/Paint/GdiSvgPaintTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GdiSvgPaintTests.cs 23 Apr 2003 22:41:31 -0000 1.2 +++ GdiSvgPaintTests.cs 20 Nov 2005 20:42:24 -0000 1.3 @@ -1,5 +1,14 @@ -using System; using System.Drawing; using System.Drawing.Drawing2D; using NUnit.Framework; using SharpVectors.Dom.Svg; using SharpVectors.Renderer.Gdi; using SharpVectors.UnitTests.Renderer; -namespace SharpVectors.UnitTests.Renderer { [TestFixture] +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using NUnit.Framework; +using SharpVectors.Dom.Svg; +using SharpVectors.Renderer.Gdi; +using SharpVectors.UnitTests.Renderer; + +namespace SharpVectors.UnitTests.Renderer +{ + [TestFixture] public class GDISvgPaintTests { SvgStyleableElement elm; @@ -7,7 +16,7 @@ [SetUp] public void SetUp() { - SvgWindow wnd = new SvgWindow(100, 100, null); + SvgWindow wnd = new SvgWindow(100, 100, new GdiRenderer()); SvgDocument doc = wnd.CreateEmptySvgDocument(); doc.LoadXml("<svg xmlns='" + SvgDocument.SvgNamespace + "'><rect /></svg>"); elm = (SvgStyleableElement)doc.SelectSingleNode("//*[local-name()='rect']"); @@ -35,8 +44,8 @@ Brush brush = paint.GetBrush(getGp()); - Assertion.AssertEquals(typeof(SolidBrush), brush.GetType()); - Assertion.Assert(isSameColor(Color.Red, ((SolidBrush)brush).Color)); + Assert.AreEqual(typeof(SolidBrush), brush.GetType()); + Assert.IsTrue(isSameColor(Color.Red, ((SolidBrush)brush).Color)); } [Test] @@ -48,8 +57,8 @@ Pen pen = paint.GetPen(getGp()); - Assertion.Assert(isSameColor(Color.Green, pen.Color)); - Assertion.AssertEquals(23, pen.Width); + Assert.IsTrue(isSameColor(Color.Green, pen.Color)); + Assert.AreEqual(23, pen.Width); } [Test] @@ -60,7 +69,7 @@ GdiSvgPaint paint = new GdiSvgPaint(elm, "stroke"); Pen pen = paint.GetPen(getGp()); - Assertion.AssertEquals(128, pen.Color.A); + Assert.AreEqual(128, pen.Color.A); } [Test] @@ -69,7 +78,7 @@ elm.SetAttribute("opacity", "0.5"); GdiSvgPaint paint = new GdiSvgPaint(elm, "fill"); Brush brush = paint.GetBrush(getGp()); - Assertion.AssertEquals(128, ((SolidBrush)brush).Color.A); + Assert.AreEqual(128, ((SolidBrush)brush).Color.A); } [Test] @@ -79,7 +88,7 @@ elm.SetAttribute("opacity", "2"); GdiSvgPaint paint = new GdiSvgPaint(elm, "stroke"); Pen pen = paint.GetPen(getGp()); - Assertion.AssertEquals(255, pen.Color.A); + Assert.AreEqual(255, pen.Color.A); } [Test] @@ -90,7 +99,7 @@ elm.SetAttribute("stroke-opacity", "0.5"); GdiSvgPaint paint = new GdiSvgPaint(elm, "stroke"); Pen pen = paint.GetPen(getGp()); - Assertion.AssertEquals(Convert.ToInt32(255*0.1*0.5), pen.Color.A); + Assert.AreEqual(Convert.ToInt32(255*0.1*0.5), pen.Color.A); } [Test] @@ -105,14 +114,14 @@ float[] correct = new float[]{2.5F, 1.5F, 1F, 2.5F, 1.5F, 1F}; float[] actual = pen.DashPattern; - Assertion.AssertEquals(6, actual.Length); - Assertion.AssertEquals(2.5F, actual[0]); - Assertion.AssertEquals(1.5F, actual[1]); - Assertion.AssertEquals(1F, actual[2]); + Assert.AreEqual(6, actual.Length); + Assert.AreEqual(2.5F, actual[0]); + Assert.AreEqual(1.5F, actual[1]); + Assert.AreEqual(1F, actual[2]); - Assertion.AssertEquals(2.5F, actual[3]); - Assertion.AssertEquals(1.5F, actual[4]); - Assertion.AssertEquals(1F, actual[5]); + Assert.AreEqual(2.5F, actual[3]); + Assert.AreEqual(1.5F, actual[4]); + Assert.AreEqual(1F, actual[5]); } [Test] @@ -121,10 +130,10 @@ elm.SetAttribute("stroke", "url(#myGradient) blue"); GdiSvgPaint paint = new GdiSvgPaint(elm, "stroke"); - Assertion.AssertEquals(SvgPaintType.UriRgbColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.UriRgbColor, paint.PaintType); Pen pen = paint.GetPen(getGp()); - Assertion.Assert(isSameColor(Color.Blue, pen.Color)); + Assert.IsTrue(isSameColor(Color.Blue, pen.Color)); } [Test] @@ -133,10 +142,10 @@ elm.SetAttribute("fill", "url(#myGradient)"); GdiSvgPaint paint = new GdiSvgPaint(elm, "fill"); - Assertion.AssertEquals(SvgPaintType.Uri, paint.PaintType); + Assert.AreEqual(SvgPaintType.Uri, paint.PaintType); Brush brush = paint.GetBrush(getGp()); - Assertion.AssertNull(brush); + Assert.IsNull(brush); } [Test] @@ -146,10 +155,10 @@ elm.SetAttribute("fill", "url(#myGradient) currentColor"); GdiSvgPaint paint = new GdiSvgPaint(elm, "fill"); - Assertion.AssertEquals(SvgPaintType.UriCurrentColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.UriCurrentColor, paint.PaintType); Brush brush = paint.GetBrush(getGp()); - Assertion.Assert(isSameColor(Color.Red, ((SolidBrush)brush).Color)); + Assert.IsTrue(isSameColor(Color.Red, ((SolidBrush)brush).Color)); } [Test] @@ -159,7 +168,7 @@ GdiSvgPaint paint = new GdiSvgPaint(elm, "stroke"); Pen pen = paint.GetPen(getGp()); - Assertion.AssertNull(pen); + Assert.IsNull(pen); } [Test] @@ -171,7 +180,7 @@ Pen pen = paint.GetPen(getGp()); - Assertion.Assert(isSameColor(Color.Red, pen.Color)); + Assert.IsTrue(isSameColor(Color.Red, pen.Color)); } } } |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:34
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUtil/SharpVectors/Polynomials In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUtil/SharpVectors/Polynomials Modified Files: Polynomial.cs SqrtPolynomial.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SqrtPolynomial.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUtil/SharpVectors/Polynomials/SqrtPolynomial.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SqrtPolynomial.cs 3 Aug 2003 18:29:25 -0000 1.1 +++ SqrtPolynomial.cs 20 Nov 2005 20:42:24 -0000 1.2 @@ -32,7 +32,7 @@ [Test] public override void TestEval() { - Assertion.AssertEquals(7, poly.Evaluate(2)); + Assert.AreEqual(7, poly.Evaluate(2)); } @@ -46,16 +46,16 @@ t[i] = ((SqrtPolynomial) poly).trapezoid(0, 1, i+1); } - Assertion.AssertEquals(2.0811388300841900, t[0]); - Assertion.AssertEquals(1.9419572339080924, t[1]); - Assertion.AssertEquals(1.9076575130141613, t[2]); - Assertion.AssertEquals(1.8991762591629650, t[3]); - Assertion.AssertEquals(1.8970624585984340, t[4]); - Assertion.AssertEquals(1.8965344208416803, t[5]); - Assertion.AssertEquals(1.8964024372601043, t[6]); - Assertion.AssertEquals(1.8963694429821338, t[7]); - Assertion.AssertEquals(1.8963611945137506, t[8]); - Assertion.AssertEquals(1.8963591324029752, t[9]); + Assert.AreEqual(2.0811388300841900, t[0]); + Assert.AreEqual(1.9419572339080924, t[1]); + Assert.AreEqual(1.9076575130141613, t[2]); + Assert.AreEqual(1.8991762591629650, t[3]); + Assert.AreEqual(1.8970624585984340, t[4]); + Assert.AreEqual(1.8965344208416803, t[5]); + Assert.AreEqual(1.8964024372601043, t[6]); + Assert.AreEqual(1.8963694429821338, t[7]); + Assert.AreEqual(1.8963611945137506, t[8]); + Assert.AreEqual(1.8963591324029752, t[9]); } [Test] @@ -69,26 +69,26 @@ t[i] = poly.trapezoid(0, 1, i+1); } - Assertion.AssertEquals(392.72319162647350, t[0]); - Assertion.AssertEquals(342.61159581323676, t[1]); - Assertion.AssertEquals(331.53834637052490, t[2]); - Assertion.AssertEquals(328.79094438739287, t[3]); - Assertion.AssertEquals(328.10605667592347, t[4]); - Assertion.AssertEquals(327.93495792953500, t[5]); - Assertion.AssertEquals(327.89219094488620, t[6]); - Assertion.AssertEquals(327.88149968013374, t[7]); - Assertion.AssertEquals(327.87882689403440, t[8]); - Assertion.AssertEquals(327.87815869939020, t[9]); - Assertion.AssertEquals(327.87799165084670, t[10]); - Assertion.AssertEquals(327.87794988871800, t[11]); - Assertion.AssertEquals(327.87793944818645, t[12]); - Assertion.AssertEquals(327.87793683805364, t[13]); - Assertion.AssertEquals(327.87793618552050, t[14]); - Assertion.AssertEquals(327.87793602238645, t[15]); - Assertion.AssertEquals(327.87793598160340, t[16]); - Assertion.AssertEquals(327.87793597140626, t[17]); - Assertion.AssertEquals(327.87793596885720, t[18]); - Assertion.AssertEquals(327.87793596821960, t[19]); + Assert.AreEqual(392.72319162647350, t[0]); + Assert.AreEqual(342.61159581323676, t[1]); + Assert.AreEqual(331.53834637052490, t[2]); + Assert.AreEqual(328.79094438739287, t[3]); + Assert.AreEqual(328.10605667592347, t[4]); + Assert.AreEqual(327.93495792953500, t[5]); + Assert.AreEqual(327.89219094488620, t[6]); + Assert.AreEqual(327.88149968013374, t[7]); + Assert.AreEqual(327.87882689403440, t[8]); + Assert.AreEqual(327.87815869939020, t[9]); + Assert.AreEqual(327.87799165084670, t[10]); + Assert.AreEqual(327.87794988871800, t[11]); + Assert.AreEqual(327.87793944818645, t[12]); + Assert.AreEqual(327.87793683805364, t[13]); + Assert.AreEqual(327.87793618552050, t[14]); + Assert.AreEqual(327.87793602238645, t[15]); + Assert.AreEqual(327.87793598160340, t[16]); + Assert.AreEqual(327.87793597140626, t[17]); + Assert.AreEqual(327.87793596885720, t[18]); + Assert.AreEqual(327.87793596821960, t[19]); } [Test] @@ -97,7 +97,7 @@ double result = Math.Floor(poly.Simpson(0,1) * 1e7) / 1e7; // This test value was generated from Mathematica 5 - Assertion.AssertEquals(1.8963584, result); + Assert.AreEqual(1.8963584, result); } protected override Polynomial makePoly() Index: Polynomial.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUtil/SharpVectors/Polynomials/Polynomial.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Polynomial.cs 3 Aug 2003 18:29:24 -0000 1.1 +++ Polynomial.cs 20 Nov 2005 20:42:24 -0000 1.2 @@ -252,20 +252,20 @@ { Polynomial poly2 = new Polynomial(1, 2, 3, 0); - Assertion.AssertEquals(2, poly2.Degree); - Assertion.AssertEquals(1, poly2[0]); - Assertion.AssertEquals(2, poly2[1]); - Assertion.AssertEquals(3, poly2[2]); + Assert.AreEqual(2, poly2.Degree); + Assert.AreEqual(1, poly2[0]); + Assert.AreEqual(2, poly2[1]); + Assert.AreEqual(3, poly2[2]); } [Test] public void TestConstructor2() { - Assertion.AssertEquals(3, poly.Degree); - Assertion.AssertEquals(1, poly[0]); - Assertion.AssertEquals(2, poly[1]); - Assertion.AssertEquals(3, poly[2]); - Assertion.AssertEquals(4, poly[3]); + Assert.AreEqual(3, poly.Degree); + Assert.AreEqual(1, poly[0]); + Assert.AreEqual(2, poly[1]); + Assert.AreEqual(3, poly[2]); + Assert.AreEqual(4, poly[3]); } [Test] @@ -273,17 +273,17 @@ { Polynomial poly2 = new Polynomial(poly); - Assertion.AssertEquals(3, poly2.Degree); - Assertion.AssertEquals(1, poly2[0]); - Assertion.AssertEquals(2, poly2[1]); - Assertion.AssertEquals(3, poly2[2]); - Assertion.AssertEquals(4, poly2[3]); + Assert.AreEqual(3, poly2.Degree); + Assert.AreEqual(1, poly2[0]); + Assert.AreEqual(2, poly2[1]); + Assert.AreEqual(3, poly2[2]); + Assert.AreEqual(4, poly2[3]); } [Test] public virtual void TestEval() { - Assertion.AssertEquals(49, poly.Evaluate(2)); + Assert.AreEqual(49, poly.Evaluate(2)); } [Test] @@ -296,23 +296,23 @@ t[i] = poly.trapezoid(0, 1, i+1); } - Assertion.AssertEquals(5.500000000000000, t[0]); - Assertion.AssertEquals(4.375000000000000, t[1]); - Assertion.AssertEquals(4.093750000000000, t[2]); - Assertion.AssertEquals(4.023437500000000, t[3]); - Assertion.AssertEquals(4.005859375000000, t[4]); - Assertion.AssertEquals(4.001464843750000, t[5]); - Assertion.AssertEquals(4.000366210937500, t[6]); - Assertion.AssertEquals(4.000091552734375, t[7]); - Assertion.AssertEquals(4.000022888183594, t[8]); - Assertion.AssertEquals(4.000005722045898, t[9]); + Assert.AreEqual(5.500000000000000, t[0]); + Assert.AreEqual(4.375000000000000, t[1]); + Assert.AreEqual(4.093750000000000, t[2]); + Assert.AreEqual(4.023437500000000, t[3]); + Assert.AreEqual(4.005859375000000, t[4]); + Assert.AreEqual(4.001464843750000, t[5]); + Assert.AreEqual(4.000366210937500, t[6]); + Assert.AreEqual(4.000091552734375, t[7]); + Assert.AreEqual(4.000022888183594, t[8]); + Assert.AreEqual(4.000005722045898, t[9]); } [Test] public virtual void TestSimpson() { // This test value was generated from Mathematica 5 - Assertion.AssertEquals(4, poly.Simpson(0, 1)); + Assert.AreEqual(4, poly.Simpson(0, 1)); } protected virtual Polynomial makePoly() |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:34
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUtil/SharpVectors/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUtil/SharpVectors/Net Modified Files: DataWebRequest.cs ExtendedHttpWebRequest.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: DataWebRequest.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUtil/SharpVectors/Net/DataWebRequest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DataWebRequest.cs 23 Oct 2005 23:39:30 -0000 1.6 +++ DataWebRequest.cs 20 Nov 2005 20:42:24 -0000 1.7 @@ -8,7 +8,6 @@ public static bool Register() { return WebRequest.RegisterPrefix("data", new DataWebRequest()); - return false; } public new WebRequest Create(Uri uri) Index: ExtendedHttpWebRequest.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUtil/SharpVectors/Net/ExtendedHttpWebRequest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ExtendedHttpWebRequest.cs 23 Oct 2005 23:39:30 -0000 1.7 +++ ExtendedHttpWebRequest.cs 20 Nov 2005 20:42:24 -0000 1.8 @@ -30,7 +30,6 @@ public static bool Register() { return WebRequest.RegisterPrefix("http://", new ExtendedHttpWebRequestCreator()); - return false; } #endregion |
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] |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:33
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/Dynamics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/Dynamics Modified Files: StyleChange.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: StyleChange.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Renderer/Gdi/Dynamics/StyleChange.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- StyleChange.cs 18 Jul 2003 00:56:21 -0000 1.4 +++ StyleChange.cs 20 Nov 2005 20:42:24 -0000 1.5 @@ -1,4 +1,13 @@ -using System; using System.Drawing; using System.Drawing.Imaging; using System.Xml; using System.IO; using NUnit.Framework; using SharpVectors.Dom.Svg; using SharpVectors.Renderer.Gdi; +using System; +using System.Drawing; +using System.Drawing.Imaging; +using System.Xml; +using System.IO; +using NUnit.Framework; +using SharpVectors.Dom.Svg; +using SharpVectors.Renderer.Gdi; + + namespace SharpVectors.UnitTests.Renderer { [TestFixture] @@ -26,12 +35,12 @@ doc.Load(svgPath); CompareUtil util = new CompareUtil(); - Assertion.Assert(util.CompareImages(renderer.Render(doc), Path.Combine(dirPath, "rectangleFillStroke.svg.png"))); + Assert.IsTrue(util.CompareImages(renderer.Render(doc), Path.Combine(dirPath, "rectangleFillStroke.svg.png"))); SvgRectElement elm = doc.GetElementById("theRect") as SvgRectElement; elm.Style.SetProperty("fill", "yellow", ""); - Assertion.Assert(util.CompareImages(renderer.Render(doc), Path.Combine(dirPath, "changeStyle.png"))); + Assert.IsTrue(util.CompareImages(renderer.Render(doc), Path.Combine(dirPath, "changeStyle.png"))); } } } |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:33
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Paths In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorObjectModel/SharpVectors/dom/svg/Paths Modified Files: SvgPathSegCurveToCubic.cs SvgPathSegCurvetoQuadratic.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgPathSegCurveToCubic.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Paths/SvgPathSegCurveToCubic.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SvgPathSegCurveToCubic.cs 3 Aug 2003 18:26:20 -0000 1.5 +++ SvgPathSegCurveToCubic.cs 20 Nov 2005 20:42:23 -0000 1.6 @@ -75,12 +75,12 @@ { SqrtPolynomial poly = segment.getArcLengthPolynomial(); - Assertion.AssertEquals(4, poly.Degree); - Assertion.AssertEquals(900, poly[4]); - Assertion.AssertEquals(-3600, poly[3]); - Assertion.AssertEquals(279000, poly[2]); - Assertion.AssertEquals(-259200, poly[1]); - Assertion.AssertEquals(145800, poly[0]); + Assert.AreEqual(4, poly.Degree); + Assert.AreEqual(900, poly[4]); + Assert.AreEqual(-3600, poly[3]); + Assert.AreEqual(279000, poly[2]); + Assert.AreEqual(-259200, poly[1]); + Assert.AreEqual(145800, poly[0]); } [Test] @@ -90,8 +90,8 @@ float result1 = segment.Length; double result2 = Math.Floor(poly.Simpson(0, 1)*1e6)/1e6; - Assertion.AssertEquals(327.877900, result1); - Assertion.AssertEquals(327.877935, result2); + Assert.AreEqual(327.877900, result1); + Assert.AreEqual(327.877935, result2); } public abstract SvgPathSegList makeSegments(); Index: SvgPathSegCurvetoQuadratic.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Paths/SvgPathSegCurvetoQuadratic.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SvgPathSegCurvetoQuadratic.cs 3 Aug 2003 18:26:20 -0000 1.5 +++ SvgPathSegCurvetoQuadratic.cs 20 Nov 2005 20:42:23 -0000 1.6 @@ -64,10 +64,10 @@ { SqrtPolynomial poly = segment.getArcLengthPolynomial(); - Assertion.AssertEquals(2, poly.Degree); - Assertion.AssertEquals(130000, poly[2]); - Assertion.AssertEquals(-122400, poly[1]); - Assertion.AssertEquals(64800, poly[0]); + Assert.AreEqual(2, poly.Degree); + Assert.AreEqual(130000, poly[2]); + Assert.AreEqual(-122400, poly[1]); + Assert.AreEqual(64800, poly[0]); } [Test] @@ -77,8 +77,8 @@ float result1 = segment.Length; double result2 = Math.Floor(poly.Simpson(0, 1)*1e6)/1e6; - Assertion.AssertEquals(215.486400, result1); - Assertion.AssertEquals(215.486377, result2); + Assert.AreEqual(215.486400, result1); + Assert.AreEqual(215.486377, result2); } public abstract SvgPathSegList makeSegments(); |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:33
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Paint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Paint Modified Files: SvgPaintTests.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgPaintTests.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorUnitTests/SharpVectors/Dom/Svg/Paint/SvgPaintTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgPaintTests.cs 28 Jun 2003 20:37:31 -0000 1.3 +++ SvgPaintTests.cs 20 Nov 2005 20:42:24 -0000 1.4 @@ -50,31 +50,31 @@ { SvgPaint paint; paint = new SvgPaint("url(rr)"); - Assertion.AssertEquals(SvgPaintType.Uri, paint.PaintType); + Assert.AreEqual(SvgPaintType.Uri, paint.PaintType); paint = new SvgPaint("url(rr) #34ff23"); - Assertion.AssertEquals(SvgPaintType.UriRgbColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.UriRgbColor, paint.PaintType); paint = new SvgPaint("url(rr) #34ff23 icc-color(somename)"); - Assertion.AssertEquals(SvgPaintType.UriRgbColorIccColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.UriRgbColorIccColor, paint.PaintType); paint = new SvgPaint("url(rr) none"); - Assertion.AssertEquals(SvgPaintType.UriNone, paint.PaintType); + Assert.AreEqual(SvgPaintType.UriNone, paint.PaintType); paint = new SvgPaint("url(rr) currentColor"); - Assertion.AssertEquals(SvgPaintType.UriCurrentColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.UriCurrentColor, paint.PaintType); paint = new SvgPaint("currentColor"); - Assertion.AssertEquals(SvgPaintType.CurrentColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.CurrentColor, paint.PaintType); paint = new SvgPaint("none"); - Assertion.AssertEquals(SvgPaintType.None, paint.PaintType); + Assert.AreEqual(SvgPaintType.None, paint.PaintType); paint = new SvgPaint("rgb(12%, 23%, 12)"); - Assertion.AssertEquals(SvgPaintType.RgbColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.RgbColor, paint.PaintType); paint = new SvgPaint("rgb(12%, 23%, 45) icc-color(somename)"); - Assertion.AssertEquals(SvgPaintType.RgbColorIccColor, paint.PaintType); + Assert.AreEqual(SvgPaintType.RgbColorIccColor, paint.PaintType); } [Test] @@ -82,8 +82,8 @@ { SvgPaint paint = new SvgPaint("none"); paint.SetUri("uri"); - Assertion.AssertEquals("uri", paint.Uri); - Assertion.AssertEquals(SvgPaintType.Uri, paint.PaintType); + Assert.AreEqual("uri", paint.Uri); + Assert.AreEqual(SvgPaintType.Uri, paint.PaintType); } [Test] @@ -92,31 +92,31 @@ SvgPaint paint = new SvgPaint("none"); paint.SetPaint(SvgPaintType.Uri, "someuri", null, null); - Assertion.AssertEquals("someuri", paint.Uri); - Assertion.AssertEquals("url(someuri)", paint.CssText); - Assertion.AssertEquals(SvgPaintType.Uri, paint.PaintType); + Assert.AreEqual("someuri", paint.Uri); + Assert.AreEqual("url(someuri)", paint.CssText); + Assert.AreEqual(SvgPaintType.Uri, paint.PaintType); paint.SetPaint(SvgPaintType.UriCurrentColor, "someuri", null, null); - Assertion.AssertEquals("someuri", paint.Uri); - Assertion.AssertEquals("url(someuri) currentColor", paint.CssText); - Assertion.AssertEquals(SvgPaintType.UriCurrentColor, paint.PaintType); + Assert.AreEqual("someuri", paint.Uri); + Assert.AreEqual("url(someuri) currentColor", paint.CssText); + Assert.AreEqual(SvgPaintType.UriCurrentColor, paint.PaintType); paint.SetPaint(SvgPaintType.UriNone, "someuri", null, null); - Assertion.AssertEquals("someuri", paint.Uri); - Assertion.AssertEquals("url(someuri) none", paint.CssText); - Assertion.AssertEquals(SvgPaintType.UriNone, paint.PaintType); + Assert.AreEqual("someuri", paint.Uri); + Assert.AreEqual("url(someuri) none", paint.CssText); + Assert.AreEqual(SvgPaintType.UriNone, paint.PaintType); paint.SetPaint(SvgPaintType.None, null, null, null); - Assertion.AssertEquals("none", paint.CssText); - Assertion.AssertEquals(SvgPaintType.None, paint.PaintType); + Assert.AreEqual("none", paint.CssText); + Assert.AreEqual(SvgPaintType.None, paint.PaintType); paint.SetPaint(SvgPaintType.CurrentColor, null, null, null); - Assertion.AssertEquals("currentColor", paint.CssText); - Assertion.AssertEquals(SvgPaintType.CurrentColor, paint.PaintType); + Assert.AreEqual("currentColor", paint.CssText); + Assert.AreEqual(SvgPaintType.CurrentColor, paint.PaintType); paint.SetPaint(SvgPaintType.UriRgbColor, "someuri", "#ff00ff", null); - Assertion.AssertEquals("url(someuri) rgb(255,0,255)", paint.CssText); - Assertion.AssertEquals(SvgPaintType.UriRgbColor, paint.PaintType); + Assert.AreEqual("url(someuri) rgb(255,0,255)", paint.CssText); + Assert.AreEqual(SvgPaintType.UriRgbColor, paint.PaintType); } } } |
From: Jeff R. <jef...@us...> - 2005-11-20 20:42:33
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint Modified Files: GradientPaintServer.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: GradientPaintServer.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorRenderingEngine/SharpVectors/Renderer/Gdi/Paint/GradientPaintServer.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GradientPaintServer.cs 11 Sep 2005 18:26:09 -0000 1.5 +++ GradientPaintServer.cs 20 Nov 2005 20:42:23 -0000 1.6 @@ -114,9 +114,9 @@ float fEffectiveTop = fTop; float fEffectiveBottom = fBottom; - if(res.GradientUnits.AnimVal.Equals(SvgUnitType.ObjectBoundingBox) && !bForceUserSpaceOnUse) + if(res.GradientUnits.AnimVal.Equals((ushort)SvgUnitType.ObjectBoundingBox) && !bForceUserSpaceOnUse) { - if(res.SpreadMethod.AnimVal.Equals(SvgSpreadMethod.Pad)) + if(res.SpreadMethod.AnimVal.Equals((ushort)SvgSpreadMethod.Pad)) { fEffectiveRight = bounds.Right; fEffectiveLeft = bounds.Left; @@ -169,9 +169,9 @@ float[] adjpositions = null; getColorsAndPositions(stops, ref adjpositions, ref adjcolors); - if(res.GradientUnits.AnimVal.Equals(SvgUnitType.ObjectBoundingBox) && !bForceUserSpaceOnUse) + if(res.GradientUnits.AnimVal.Equals((ushort)SvgUnitType.ObjectBoundingBox) && !bForceUserSpaceOnUse) { - if(res.SpreadMethod.AnimVal.Equals(SvgSpreadMethod.Pad)) + if(res.SpreadMethod.AnimVal.Equals((ushort)SvgSpreadMethod.Pad)) { for(int i=0;i<adjpositions.Length;i++) { @@ -229,15 +229,15 @@ brush.InterpolationColors = cb; - if(res.SpreadMethod.AnimVal.Equals(SvgSpreadMethod.Reflect)) + if(res.SpreadMethod.AnimVal.Equals((ushort)SvgSpreadMethod.Reflect)) { brush.WrapMode = WrapMode.TileFlipXY; } - else if(res.SpreadMethod.AnimVal.Equals(SvgSpreadMethod.Repeat)) + else if(res.SpreadMethod.AnimVal.Equals((ushort)SvgSpreadMethod.Repeat)) { brush.WrapMode = WrapMode.Tile; } - else if(res.SpreadMethod.AnimVal.Equals(SvgSpreadMethod.Pad)) + else if(res.SpreadMethod.AnimVal.Equals((ushort)SvgSpreadMethod.Pad)) { brush.WrapMode = WrapMode.Tile; } |