[corlib] Improve CancellationTokenSource test
[mono.git] / mcs / class / System.Drawing / Test / DrawingTest / Test / Graphics.cs
index 13b4c1eaf0aa80c2c7501568d1448eae5738a1a6..9848565605712e7fde336a7da9279d79c3dca56e 100644 (file)
@@ -38,6 +38,9 @@ using System.Drawing.Text;
 using System.Drawing.Imaging;\r
 using DrawingTestHelper;\r
 using System.IO;\r
+#if !MONOTOUCH\r
+using  NUnit.Framework.SyntaxHelpers;\r
+#endif\r
 \r
 namespace Test.Sys.Drawing.GraphicsFixtures {\r
        #region GraphicsFixtureProps\r
@@ -63,14 +66,14 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                [Test]\r
                public void ClipTest_1() {\r
                        Region r = new Region();\r
-                       Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));\r
+                       Assert.That(r.Equals(t.Graphics.Clip, t.Graphics), Is.True);\r
                }\r
 \r
                [Test]\r
                public void ClipTest_2() {\r
                        Region r = new Region(new Rectangle(10, 10, 60, 60));\r
                        t.Graphics.Clip = r;\r
-                       Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));\r
+                       Assert.That(r.Equals(t.Graphics.Clip, t.Graphics), Is.True);\r
 \r
                        Pen redPen   = new Pen(Color.Red, 3);\r
                        Pen greenPen = new Pen(Color.Green, 3);\r
@@ -94,7 +97,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw lines between original points to screen.\r
                        t.Graphics.DrawLines(redPen, curvePoints);\r
                        t.Show ();\r
-                       Assert.IsTrue(t.PDCompare(TOLERANCE));\r
+                       Assert.That(t.PDCompare(TOLERANCE), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -144,18 +147,18 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                [Test]\r
                public void ClipBoundsTest() {\r
                        Region r = new Region();\r
-                       Assert.IsTrue(t.Graphics.ClipBounds.Equals(r.GetBounds(t.Graphics)));\r
+                       Assert.That(t.Graphics.ClipBounds.Equals(r.GetBounds(t.Graphics)), Is.True);\r
 \r
                        RectangleF rf = new RectangleF(10, 10, 60, 60);\r
                        r = new Region(rf);\r
                        t.Graphics.Clip = r;\r
-                       Assert.IsTrue(rf.Equals(t.Graphics.ClipBounds));\r
+                       Assert.That(rf.Equals(t.Graphics.ClipBounds), Is.True);\r
                }\r
 \r
                [Test]\r
                public void CompositingModeTest() {\r
                        //TODO: seems to draw equal images\r
-                       Assert.AreEqual(CompositingMode.SourceOver, t.Graphics.CompositingMode);\r
+                       Assert.That (CompositingMode.SourceOver, Is.EqualTo (t.Graphics.CompositingMode));\r
 \r
                        Bitmap b = new Bitmap(100, 100);\r
                        Graphics g = Graphics.FromImage(b);\r
@@ -174,7 +177,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawImage(b, 300, 300);\r
 \r
                        t.Show ();\r
-                       Assert.IsTrue(t.PDCompare(TOLERANCE));\r
+                       Assert.That(t.PDCompare(TOLERANCE), Is.True);\r
                }\r
 \r
                [Test] //TBD\r
@@ -183,91 +186,91 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
 \r
                [Test]\r
                public void DpiXTest() {\r
-                       Assert.IsTrue(t.Graphics.DpiX == 96f);\r
+                       Assert.That(t.Graphics.DpiX == 96f, Is.True);\r
                }\r
 \r
                [Test]\r
                public void DpiYTest() {\r
-                       Assert.IsTrue(t.Graphics.DpiY == 96f);\r
+                       Assert.That(t.Graphics.DpiY == 96f, Is.True);\r
                }\r
 \r
                [Test] //TBD\r
                public void InterpolationModeTest() {\r
-                       Assert.AreEqual(InterpolationMode.Bilinear, t.Graphics.InterpolationMode);\r
+                       Assert.That (InterpolationMode.Bilinear, Is.EqualTo (t.Graphics.InterpolationMode));\r
                }\r
 \r
                [Test]\r
                public void IsClipEmtpyTest() {\r
-                       Assert.IsFalse(t.Graphics.IsClipEmpty);\r
+                       Assert.That (t.Graphics.IsClipEmpty, Is.False);\r
 \r
                        try {\r
                                t.Graphics.Clip = null;\r
                                Assert.Fail("The ArgumentNullException was not thrown");\r
                        }\r
                        catch(Exception e) {\r
-                               Assert.AreEqual(e.GetType(), typeof(ArgumentNullException));\r
+                               Assert.That (e.GetType(), Is.EqualTo (typeof(ArgumentNullException)));\r
                        }\r
 \r
                        Region r = new Region(new Rectangle(10, 10, 0, 0));\r
                        t.Graphics.Clip = r;\r
 \r
-                       Assert.IsTrue( t.Graphics.IsClipEmpty);\r
+                       Assert.That( t.Graphics.IsClipEmpty, Is.True);\r
                }\r
 \r
                [Test]\r
                public void IsVisibleClipEmtpyTest() {\r
-                       Assert.IsFalse(t.Graphics.IsVisibleClipEmpty, "default t.Graphics.IsVisibleClipEmpty");\r
+                       Assert.That (t.Graphics.IsVisibleClipEmpty, Is.False, "default t.Graphics.IsVisibleClipEmpty");\r
 \r
                        Region r = new Region(new Rectangle(512, 512, 100, 100));\r
                        t.Graphics.Clip = r;\r
-                       Assert.IsFalse(t.Graphics.IsClipEmpty);\r
-                       Assert.IsTrue(t.Graphics.IsVisibleClipEmpty);\r
+                       Assert.That (t.Graphics.IsClipEmpty, Is.False);\r
+                       Assert.That(t.Graphics.IsVisibleClipEmpty, Is.True);\r
                }\r
 \r
                [Test]\r
                public void PageScaleTest() {\r
-                       Assert.AreEqual(1f, t.Graphics.PageScale);\r
+                       Assert.That (1f, Is.EqualTo (t.Graphics.PageScale));\r
                }\r
 \r
                [Test]\r
                public void PageUnitTest() {\r
-                       Assert.AreEqual(GraphicsUnit.Display, t.Graphics.PageUnit);\r
+                       Assert.That (GraphicsUnit.Display, Is.EqualTo (t.Graphics.PageUnit));\r
                }\r
 \r
                [Test]\r
                public void PixelOffsetModeTest() {\r
-                       Assert.AreEqual(PixelOffsetMode.Default, t.Graphics.PixelOffsetMode);\r
+                       Assert.That (PixelOffsetMode.Default, Is.EqualTo (t.Graphics.PixelOffsetMode));\r
                }\r
 \r
                [Test]\r
                [Category("NotWorking")]\r
                public void RenderingOriginTest() {\r
-                       Assert.AreEqual(new Point(0,0), t.Graphics.RenderingOrigin);\r
+                       Assert.That (new Point(0,0), Is.EqualTo (t.Graphics.RenderingOrigin));\r
                }\r
 \r
                [Test]\r
                public void SmoothingModeTest() {\r
-                       Assert.AreEqual(SmoothingMode.None, t.Graphics.SmoothingMode);\r
+                       Assert.That (SmoothingMode.None, Is.EqualTo (t.Graphics.SmoothingMode));\r
                }\r
 \r
                [Test]\r
                public void TextContrastTest() {\r
-                       Assert.AreEqual(4, t.Graphics.TextContrast);\r
+                       Assert.That (4, Is.EqualTo (t.Graphics.TextContrast));\r
                }\r
 \r
                [Test]\r
                public void TextRenderingHintTest() {\r
-                       Assert.AreEqual(TextRenderingHint.SystemDefault, t.Graphics.TextRenderingHint);\r
+                       Assert.That (TextRenderingHint.SystemDefault, Is.EqualTo (t.Graphics.TextRenderingHint));\r
                }\r
 \r
                [Test]\r
                public void TransformTest() {\r
-                       Assert.AreEqual(new Matrix(), t.Graphics.Transform);\r
+                       Assert.That (new Matrix(), Is.EqualTo (t.Graphics.Transform));\r
                }\r
 \r
                [Test]\r
                public void VisibleClipBoundsTest() {\r
-                       Assert.AreEqual(new RectangleF(0, 0, 512, 512), t.Graphics.VisibleClipBounds);\r
+                       Assert.That (new RectangleF(0, 0, 512, 512), Is.EqualTo (t.Graphics.VisibleClipBounds));\r
                }\r
        }\r
 \r
@@ -317,35 +320,35 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawImage(bmp, new Point[]{new Point(170,10), new Point(250,0), new Point(100,100)}, src, GraphicsUnit.Pixel );\r
                        t.Graphics.DrawImage(bmp, new PointF[]{new PointF(70,10), new PointF(150,0), new PointF(10,100)}, srcF, GraphicsUnit.Pixel );\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage2() {\r
                        t.Graphics.DrawImage(bmp, dst, src, GraphicsUnit.Pixel);\r
                        t.Graphics.DrawImage(bmp, dstF, srcF, GraphicsUnit.Pixel);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage3() {\r
                        t.Graphics.DrawImage(bmp, 10.0F, 10.0F, srcF, GraphicsUnit.Pixel);\r
                        t.Graphics.DrawImage(bmp, 70.0F, 150.0F, 250.0F, 150.0F);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage4() {\r
                        t.Graphics.DrawImage(bmp, dst);\r
                        t.Graphics.DrawImage(bmp, dstF);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage5() {\r
                        t.Graphics.SetClip( new Rectangle(70, 0, 20, 200));\r
                        t.Graphics.DrawImage(bmp, new Point[]{new Point(50,50), new Point(250,30), new Point(100,150)}, src, GraphicsUnit.Pixel );\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage6() {\r
@@ -353,28 +356,28 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.SetClip( new Rectangle(70, 0, 20, 200));\r
                        t.Graphics.DrawImage(bmp, new Point[]{new Point(50,50), new Point(250,30), new Point(100,150)}, src, GraphicsUnit.Pixel );\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage7() {\r
                        t.Graphics.DrawImage(bmp, 170, 70, src, GraphicsUnit.Pixel);\r
                        t.Graphics.DrawImage(bmp, 70, 350, 350, 150);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage8() {\r
                        t.Graphics.DrawImage(bmp, new Point[]{new Point(170,10), new Point(250,10), new Point(100,100)} );\r
                        t.Graphics.DrawImage(bmp, new PointF[]{new PointF(170,100), new PointF(250,100), new PointF(100,190)} );\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImage9() {\r
                        t.Graphics.DrawImage(bmp, 0, 0);\r
                        t.Graphics.DrawImage(bmp, 200, 200);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImagePageUnit() {\r
@@ -387,7 +390,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
 \r
                        t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImagePageUnit_2() {\r
@@ -401,7 +404,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
 \r
                        t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImagePageUnit_3() {\r
@@ -409,7 +412,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.ScaleTransform(0.3f, 0.3f);\r
                        t.Graphics.DrawImage(bmp2, new Rectangle(100, 100, 100, 100));\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImagePageUnit_4() {\r
@@ -417,7 +420,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.ScaleTransform(0.5f, 0.5f);\r
                        t.Graphics.DrawImage(bmp, 50, 50);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImagePageUnitClip() {\r
@@ -432,33 +435,27 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.SetClip( new Rectangle(120, 120, 50, 100) );\r
                        t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
-#if TARGET_JVM\r
-               [Category("NotWorking")] // defect 6145\r
-#endif\r
                public void DrawImageWithResolution() {\r
                        t.Graphics.DrawImage(bmp2, 0, 0);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImageInContainer1() {\r
                        t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);\r
                        t.Graphics.DrawImage(bmp, 0, 0);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
-#if TARGET_JVM\r
-               [Category ("NotWorking")] // defect 6145\r
-#endif\r
                public void DrawImageInContainer2() {\r
                        t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);\r
                        t.Graphics.DrawImage(bmp2, 0, 0);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImageInContainer3() {\r
@@ -467,7 +464,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.ScaleTransform(0.5f, 0.5f);\r
                        t.Graphics.DrawImage(bmp2, 0, 0);\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
                [Test]\r
                public void DrawImageInContainer4() {\r
@@ -482,7 +479,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);\r
                        t.Graphics.EndContainer( c );\r
                        t.Show();\r
-                       Assert.IsTrue(t.Compare());\r
+                       Assert.That(t.Compare(), Is.True);\r
                }\r
        }\r
        #endregion\r
@@ -509,7 +506,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                [Test]\r
                public void FillModeAlternate() {\r
                        GraphicsPath p = new GraphicsPath();\r
-                       Assert.AreEqual(FillMode.Alternate, p.FillMode);\r
+                       Assert.That (FillMode.Alternate, Is.EqualTo (p.FillMode));\r
                }\r
                [Test]\r
                public void FillModeAlternate_1() {\r
@@ -528,7 +525,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        path.FillMode = FillMode.Alternate;\r
                        t.Graphics.FillPath( Brushes.Blue, path );\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public void FillModeAlternate_2() {\r
@@ -541,7 +538,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        path.FillMode = FillMode.Alternate;\r
                        t.Graphics.FillPath( Brushes.Blue, path );\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public void FillModeAlternate_3() {\r
@@ -559,7 +556,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        path.FillMode = FillMode.Alternate;\r
                        t.Graphics.FillPath( Brushes.Blue, path );\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public void FillModeWinding_1() {\r
@@ -578,7 +575,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        path.FillMode = FillMode.Winding;\r
                        t.Graphics.FillPath( Brushes.Blue, path );\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public void FillModeWinding_2() {\r
@@ -591,7 +588,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        path.FillMode = FillMode.Winding;\r
                        t.Graphics.FillPath( Brushes.Blue, path );\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public void FillModeWinding_3() {\r
@@ -609,7 +606,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        path.FillMode = FillMode.Winding;\r
                        t.Graphics.FillPath( Brushes.Blue, path );\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
        }\r
@@ -671,8 +668,36 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill untransformed rectangle with green.\r
                        t.Graphics.FillRectangle(new SolidBrush(Color.Green), 0.0F, 0.0F, 200.0F, 200.0F);\r
                        t.Show ();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
+               }\r
+\r
+               [Test]\r
+               public void MeasureString () {\r
+                       Bitmap bmp = new Bitmap (400, 300, PixelFormat.Format32bppArgb);\r
+                       Graphics graphics = Graphics.FromImage (bmp);\r
+                       graphics.PageUnit = GraphicsUnit.Point;\r
+\r
+                       string drawString = "Sample Text in points";\r
+                       Font drawFont = new Font ("Arial Black", 70, FontStyle.Regular);\r
+                       SolidBrush drawBrush = new SolidBrush (Color.Blue);\r
+\r
+                       float netWidth1 = 836.1719f;\r
+                       float netWidth2 = 1114.896f;\r
+                       float netHeight1 = 98.71094f;\r
+                       float netHeight2 = 131.6146f;\r
+\r
+                       SizeF size = graphics.MeasureString (drawString, drawFont, new PointF (0, 0), StringFormat.GenericTypographic);\r
+\r
+                       Assert.That (Math.Abs (size.Width - netWidth1) / netWidth1 < 0.01, Is.True);\r
+                       Assert.That (Math.Abs (size.Height - netHeight1) / netHeight1 < 0.01, Is.True);\r
+\r
+                       graphics.PageUnit = GraphicsUnit.Pixel;\r
+                       size = graphics.MeasureString (drawString, drawFont, new PointF (0, 0), StringFormat.GenericTypographic);\r
+\r
+                       Assert.That (Math.Abs (size.Width - netWidth2) / netWidth2 < 0.01, Is.True);\r
+                       Assert.That (Math.Abs (size.Height - netHeight2) / netHeight2 < 0.01, Is.True);\r
                }\r
+\r
                [Test]\r
                public virtual void BeginContainerTest_2() {\r
                        t.Graphics.DrawRectangle( Pens.Black, new Rectangle(70, 70, 50, 100) );\r
@@ -699,16 +724,16 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.FillRectangle( Brushes.Yellow, new Rectangle(150, 80, 10, 10) );\r
 \r
                        t.Show ();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public virtual void ClearTest() {\r
                        // Clear screen with teal background.\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        t.Graphics.Clear(Color.Teal);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -726,37 +751,37 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw arc to screen.\r
                        t.Graphics.DrawArc(blackPen, (int)x, (int)y, (int)width, (int)height, (int)startAngle, (int)sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        startAngle =  10.0F;\r
                        sweepAngle = 120.0F;\r
                        t.Graphics.DrawArc(blackPen, new Rectangle((int)x, (int)y, (int)width, (int)height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        startAngle =  10.0F;\r
                        sweepAngle = 190.0F;\r
                        t.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        startAngle =  10.0F;\r
                        sweepAngle = 300.0F;\r
                        t.Graphics.DrawArc(blackPen, new RectangleF(x, y, width, height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        startAngle =  -179.9F;\r
                        sweepAngle = -359.9F;\r
                        t.Graphics.DrawArc(blackPen, new RectangleF(x, y, width, height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        startAngle =  -10.0F;\r
                        sweepAngle = -300.0F;\r
                        t.Graphics.DrawArc(blackPen, new RectangleF(x, y, width, height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -778,21 +803,21 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                                controlX2, controlY2,\r
                                endX, endY);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        t.Graphics.DrawBezier(blackPen, new PointF( startX, startY),\r
                                new PointF(controlX1, controlY1),\r
                                new PointF(controlX2, controlY2),\r
                                new PointF(endX, endY));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
                        t.Graphics.DrawBezier(blackPen, new Point((int)startX, (int)startY),\r
                                new Point((int)controlX1, (int)controlY1),\r
                                new Point((int)controlX2, (int)controlY2),\r
                                new Point((int)endX, (int)endY));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -814,7 +839,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw arc to screen.\r
                        t.Graphics.DrawBeziers(blackPen, bezierPoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        PointF startF = new PointF(100.0F, 100.0F);\r
@@ -831,7 +856,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw arc to screen.\r
                        t.Graphics.DrawBeziers(blackPen, bezierPointsF);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -864,14 +889,14 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw closed curve to screen.\r
                        t.Graphics.DrawClosedCurve(greenPen, curvePoints, tension, aFillMode);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        aFillMode = FillMode.Winding;\r
                        // Draw closed curve to screen.\r
                        t.Graphics.DrawClosedCurve(greenPen, curvePoints, tension, aFillMode);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -905,17 +930,17 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw curve to screen.\r
                        t.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawCurve(greenPen, curvePoints, tension);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawCurve(greenPen, curvePoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -949,22 +974,22 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw curve to screen.\r
                        t.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawCurve(greenPen, curvePoints, tension);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawCurve(greenPen, curvePoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -979,12 +1004,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw ellipse to screen.\r
                        t.Graphics.DrawEllipse(blackPen, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawEllipse(blackPen, new Rectangle(x, y, width, height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -999,25 +1024,25 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw ellipse to screen.\r
                        t.Graphics.DrawEllipse(blackPen, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawEllipse(blackPen, new RectangleF(x, y, width, height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                static string getInFile (string file) {\r
-                       string sRslt;                                           
-                       
-                       sRslt = Path.GetFullPath (file);
-                       
-                       if (! File.Exists (file))
-                               sRslt = Path.Combine (
-                                       Path.Combine ("..", ".."),
-                                       file);
-
-                       return sRslt;
+                       string sRslt;                                           \r
+                       \r
+                       sRslt = Path.GetFullPath (file);\r
+                       \r
+                       if (! File.Exists (file))\r
+                               sRslt = Path.Combine (\r
+                                       Path.Combine ("..", ".."),\r
+                                       file);\r
+\r
+                       return sRslt;\r
                }\r
 \r
                [Test]\r
@@ -1031,11 +1056,11 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw icon to screen.\r
                        t.Graphics.DrawIcon(newIcon, x, y);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
 \r
                        t.Graphics.DrawIcon(newIcon, new Rectangle(200, 300, 125, 345));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1048,7 +1073,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw icon to screen.\r
                        t.Graphics.DrawIconUnstretched(newIcon, rect);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 #if INTPTR_SUPPORTED\r
                // Define DrawImageAbort callback method.\r
@@ -1114,22 +1139,22 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw image to screen.\r
                        t.Graphics.DrawImageUnscaled(newImage, x, y, 100, 125);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawImageUnscaled(newImage, new Rectangle(x, y, 34, 235));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawImageUnscaled(newImage, x, y);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawImageUnscaled(newImage, new Point(x, y));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1144,12 +1169,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw line to screen.\r
                        t.Graphics.DrawLine(blackPen, x1, y1, x2, y2);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawLine(blackPen, new Point( x1, y1), new Point( x2, y2));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1164,12 +1189,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw line to screen.\r
                        t.Graphics.DrawLine(blackPen, x1, y1, x2, y2);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawLine(blackPen, new PointF( x1, y1), new PointF( x2, y2));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1186,7 +1211,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        //Draw lines to screen.\r
                        t.Graphics.DrawLines(pen, points);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1203,7 +1228,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        //Draw lines to screen.\r
                        t.Graphics.DrawLines(pen, points);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1216,7 +1241,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw graphics path to screen.\r
                        t.Graphics.DrawPath(blackPen, graphPath);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1234,12 +1259,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw pie to screen.\r
                        t.Graphics.DrawPie(blackPen, x, y, width, height, startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawPie(blackPen, new RectangleF( x, y, width, height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1257,12 +1282,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw pie to screen.\r
                        t.Graphics.DrawPie(blackPen, x, y, width, height, startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawPie(blackPen, new Rectangle( x, y, width, height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1289,7 +1314,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw polygon to screen.\r
                        t.Graphics.DrawPolygon(blackPen, curvePoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare()); // .NET's lines of polygon is more wide\r
+                       Assert.That(t.PDCompare()); // .NET's lines of polygon is more wi, Is.Truede\r
                }\r
 \r
                [Test]\r
@@ -1316,7 +1341,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw polygon to screen.\r
                        t.Graphics.DrawPolygon(blackPen, curvePoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1331,17 +1356,17 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rectangle to screen.\r
                        t.Graphics.DrawRectangle(blackPen, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawRectangle(blackPen, (int)x, (int)y, (int)width, (int)height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.DrawRectangle(blackPen, new Rectangle( (int)x, (int)y, (int)width, (int)height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1357,7 +1382,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rectangles to screen.\r
                        t.Graphics.DrawRectangles(blackPen, rects);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1373,7 +1398,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rectangles to screen.\r
                        t.Graphics.DrawRectangles(blackPen, rects);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test] //TBD: add more combinations\r
@@ -1393,21 +1418,21 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw string to screen.\r
                        t.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare()); // in .net the font is shmoothed\r
+                       Assert.That(t.PDCompare()); // in .net the font is shmooth, Is.Trueed\r
                        SetUp();\r
 \r
                        drawFormat.FormatFlags = StringFormatFlags.NoClip;\r
                        // Draw string to screen.\r
                        t.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        drawFormat.FormatFlags = StringFormatFlags.FitBlackBox;\r
                        // Draw string to screen.\r
                        t.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1424,7 +1449,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill untransformed rectangle with green.\r
                        t.Graphics.FillRectangle(new SolidBrush(Color.Green), 0, 0, 200, 200);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test] //TBD\r
@@ -1440,7 +1465,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill large rectangle to show clipping region.\r
                        t.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 300, 300);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1460,18 +1485,18 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill curve on screen.\r
                        t.Graphics.FillClosedCurve(redBrush, points);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
 \r
                        SetUp();\r
                        t.Graphics.FillClosedCurve(redBrush, points, newFillMode);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
 \r
                        SetUp();\r
                        newFillMode = FillMode.Alternate;\r
                        t.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1491,18 +1516,18 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill curve on screen.\r
                        t.Graphics.FillClosedCurve(redBrush, points);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillClosedCurve(redBrush, points, newFillMode);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        newFillMode = FillMode.Alternate;\r
                        t.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1517,12 +1542,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill ellipse on screen.\r
                        t.Graphics.FillEllipse(redBrush, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillEllipse(redBrush, new Rectangle( x, y, width, height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1537,12 +1562,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill ellipse on screen.\r
                        t.Graphics.FillEllipse(redBrush, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillEllipse(redBrush, new RectangleF( x, y, width, height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1555,7 +1580,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill graphics path to screen.\r
                        t.Graphics.FillPath(redBrush, graphPath);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1573,17 +1598,17 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill pie to screen.\r
                        t.Graphics.FillPie(redBrush, new Rectangle(x, y, width, height), startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillPie(redBrush, x, y, width, height, (int)startAngle, (int)sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillPie(redBrush, (float)x, (float)y, (float)width, (float)height, startAngle, sweepAngle);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1611,17 +1636,17 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill polygon to screen.\r
                        t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Winding);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Alternate);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillPolygon(blueBrush, curvePoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1649,17 +1674,17 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill polygon to screen.\r
                        t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Winding);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Alternate);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillPolygon(blueBrush, curvePoints);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1674,12 +1699,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill rectangle to screen.\r
                        t.Graphics.FillRectangle(blueBrush, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillRectangle(blueBrush, new Rectangle( x, y, width, height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1694,12 +1719,12 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill rectangle to screen.\r
                        t.Graphics.FillRectangle(blueBrush, x, y, width, height);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                        SetUp();\r
 \r
                        t.Graphics.FillRectangle(blueBrush, new RectangleF( x, y, width, height));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1715,7 +1740,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill rectangles to screen.\r
                        t.Graphics.FillRectangles(blueBrush, rects);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1731,7 +1756,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill rectangles to screen.\r
                        t.Graphics.FillRectangles(blueBrush, rects);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1745,7 +1770,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill region to screen.\r
                        t.Graphics.FillRegion(blueBrush, fillRegion);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1775,7 +1800,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Show();\r
                        t.Graphics.DrawRectangle(new Pen(Color.Red), intersectRect);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1802,7 +1827,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                                t.Show();\r
                        }\r
 \r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1852,7 +1877,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                                new Pen(Color.Blue, 1),\r
                                Rectangle.Round(measureRect2));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test] //TBD: add more overloads\r
@@ -1898,7 +1923,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                                Brushes.Black,\r
                                new PointF(100, 0));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1916,7 +1941,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, translated ellipse.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1934,7 +1959,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, translated ellipse.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1952,7 +1977,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, translated ellipse.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1971,7 +1996,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawRectangle(new Pen(Color.Black), clipRect);\r
                        t.Graphics.DrawRectangle(new Pen(Color.Red), Rectangle.Round(intersectRectF));\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -1988,7 +2013,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.Restore(transState);\r
                        t.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 100, 100);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2000,7 +2025,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw translated, rotated ellipse to screen.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2012,7 +2037,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw translated, rotated ellipse to screen.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());  // Line width problem\r
+                       Assert.That(t.PDCompare());  // Line width probl, Is.Trueem\r
                }\r
 \r
                [Test]\r
@@ -2024,7 +2049,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, scaled rectangle to screen.\r
                        t.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare()); // Line width problem\r
+                       Assert.That(t.PDCompare()); // Line width probl, Is.Trueem\r
                }\r
 \r
                [Test]\r
@@ -2036,7 +2061,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, scaled rectangle to screen.\r
                        t.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test] //TBD: add more combination\r
@@ -2048,7 +2073,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill rectangle to demonstrate clip region.\r
                        t.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2073,7 +2098,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                                points[0],\r
                                points[1]);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2089,7 +2114,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Fill rectangle to demonstrate translated clip region.\r
                        t.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2101,7 +2126,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, translated ellipse to screen.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare()); // Line width problem\r
+                       Assert.That(t.PDCompare()); // Line width probl, Is.Trueem\r
                }\r
 \r
                [Test]\r
@@ -2113,7 +2138,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        // Draw rotated, translated ellipse to screen.\r
                        t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);\r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2141,7 +2166,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawLine(Pens.Yellow, 10, 70, 70, 10);\r
 \r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -2160,7 +2185,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawLine(Pens.Green, 10, 70, 70, 10);\r
 \r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
                [Test]\r
                public virtual void TransfromPageScaleUnits_3() {\r
@@ -2190,7 +2215,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);\r
 \r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
        }\r
 \r
@@ -3655,7 +3680,7 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        t.Graphics.FillRectangle( Brushes.SeaGreen, 0, 0, 100, 100 );\r
 \r
                        t.Show();\r
-                       Assert.IsTrue(t.PDCompare());\r
+                       Assert.That(t.PDCompare(), Is.True);\r
                }\r
 \r
                [Test]\r
@@ -3673,16 +3698,16 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
 \r
                        GraphicsContainer c1 = t.Graphics.BeginContainer();\r
 \r
-                       Assert.AreEqual(CompositingQuality.Default, t.Graphics.CompositingQuality);\r
-                       Assert.AreEqual(CompositingMode.SourceOver, t.Graphics.CompositingMode);\r
-                       Assert.AreEqual(InterpolationMode.Bilinear, t.Graphics.InterpolationMode);\r
-                       Assert.AreEqual(1.0F, t.Graphics.PageScale);\r
-                       Assert.AreEqual(GraphicsUnit.Display, t.Graphics.PageUnit);\r
-                       Assert.AreEqual(PixelOffsetMode.Default, t.Graphics.PixelOffsetMode);\r
-                       Assert.AreEqual(SmoothingMode.None, t.Graphics.SmoothingMode);\r
-                       Assert.AreEqual(true, t.Graphics.Transform.IsIdentity);\r
-                       Assert.AreEqual(4.0f, t.Graphics.TextContrast);\r
-                       Assert.AreEqual(TextRenderingHint.SystemDefault, t.Graphics.TextRenderingHint);\r
+                       Assert.That (CompositingQuality.Default, Is.EqualTo (t.Graphics.CompositingQuality));\r
+                       Assert.That (CompositingMode.SourceOver, Is.EqualTo (t.Graphics.CompositingMode));\r
+                       Assert.That (InterpolationMode.Bilinear, Is.EqualTo (t.Graphics.InterpolationMode));\r
+                       Assert.That (1.0F, Is.EqualTo (t.Graphics.PageScale));\r
+                       Assert.That (GraphicsUnit.Display, Is.EqualTo (t.Graphics.PageUnit));\r
+                       Assert.That (PixelOffsetMode.Default, Is.EqualTo (t.Graphics.PixelOffsetMode));\r
+                       Assert.That (SmoothingMode.None, Is.EqualTo (t.Graphics.SmoothingMode));\r
+                       Assert.That (true, Is.EqualTo (t.Graphics.Transform.IsIdentity));\r
+                       Assert.That (4.0f, Is.EqualTo (t.Graphics.TextContrast));\r
+                       Assert.That (TextRenderingHint.SystemDefault, Is.EqualTo (t.Graphics.TextRenderingHint));\r
 \r
                        t.Graphics.EndContainer(c1);\r
                }\r
@@ -3703,16 +3728,16 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
 \r
                        t.Graphics.Restore(s);\r
 \r
-                       Assert.AreEqual(CompositingQuality.Default, t.Graphics.CompositingQuality);\r
-                       Assert.AreEqual(CompositingMode.SourceOver, t.Graphics.CompositingMode);\r
-                       Assert.AreEqual(InterpolationMode.Bilinear, t.Graphics.InterpolationMode);\r
-                       Assert.AreEqual(1.0F, t.Graphics.PageScale);\r
-                       Assert.AreEqual(GraphicsUnit.Display, t.Graphics.PageUnit);\r
-                       Assert.AreEqual(PixelOffsetMode.Default, t.Graphics.PixelOffsetMode);\r
-                       Assert.AreEqual(SmoothingMode.None, t.Graphics.SmoothingMode);\r
-                       Assert.AreEqual(true, t.Graphics.Transform.IsIdentity);\r
-                       Assert.AreEqual(4.0f, t.Graphics.TextContrast);\r
-                       Assert.AreEqual(TextRenderingHint.SystemDefault, t.Graphics.TextRenderingHint);\r
+                       Assert.That (CompositingQuality.Default, Is.EqualTo (t.Graphics.CompositingQuality));\r
+                       Assert.That (CompositingMode.SourceOver, Is.EqualTo (t.Graphics.CompositingMode));\r
+                       Assert.That (InterpolationMode.Bilinear, Is.EqualTo (t.Graphics.InterpolationMode));\r
+                       Assert.That (1.0F, Is.EqualTo (t.Graphics.PageScale));\r
+                       Assert.That (GraphicsUnit.Display, Is.EqualTo (t.Graphics.PageUnit));\r
+                       Assert.That (PixelOffsetMode.Default, Is.EqualTo (t.Graphics.PixelOffsetMode));\r
+                       Assert.That (SmoothingMode.None, Is.EqualTo (t.Graphics.SmoothingMode));\r
+                       Assert.That (true, Is.EqualTo (t.Graphics.Transform.IsIdentity));\r
+                       Assert.That (4.0f, Is.EqualTo (t.Graphics.TextContrast));\r
+                       Assert.That (TextRenderingHint.SystemDefault, Is.EqualTo (t.Graphics.TextRenderingHint));\r
                }\r
 \r
                [Test]\r
@@ -3727,19 +3752,19 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        GraphicsContainer c3 = t.Graphics.BeginContainer();\r
 \r
                        t.Graphics.EndContainer(c2);\r
-                       Assert.AreEqual(3, t.Graphics.PageScale);\r
+                       Assert.That (3, Is.EqualTo (t.Graphics.PageScale));\r
 \r
                        t.Graphics.PageScale = 5;\r
                        GraphicsState c5 = t.Graphics.Save();\r
 \r
                        t.Graphics.EndContainer(c3);\r
-                       Assert.AreEqual(5, t.Graphics.PageScale);\r
+                       Assert.That (5, Is.EqualTo (t.Graphics.PageScale));\r
 \r
                        t.Graphics.Restore(c5);\r
-                       Assert.AreEqual(5, t.Graphics.PageScale);\r
+                       Assert.That (5, Is.EqualTo (t.Graphics.PageScale));\r
 \r
                        t.Graphics.EndContainer(c1);\r
-                       Assert.AreEqual(2, t.Graphics.PageScale);\r
+                       Assert.That (2, Is.EqualTo (t.Graphics.PageScale));\r
                }\r
                [Test]\r
                public void SaveRestoreGraphicsProps_4() {\r
@@ -3750,10 +3775,10 @@ namespace Test.Sys.Drawing.GraphicsFixtures {
                        GraphicsState c2 = t.Graphics.Save();\r
 \r
                        t.Graphics.EndContainer(c1);\r
-                       Assert.AreEqual(2, t.Graphics.PageScale);\r
+                       Assert.That (2, Is.EqualTo (t.Graphics.PageScale));\r
 \r
                        t.Graphics.Restore(c2);\r
-                       Assert.AreEqual(2, t.Graphics.PageScale);\r
+                       Assert.That (2, Is.EqualTo (t.Graphics.PageScale));\r
                }\r
        }\r
        #endregion\r