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