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)); } } } |