-2004-03-17 Ravindra <rkumar@novell.com>
+2004-03-17 Ravindra <rkumar@novell.com>
+ * TestBlend.cs: Added.
+ * TestColorBlend.cs: Added.
+
+2004-03-17 Ravindra <rkumar@novell.com>
* System.Drawing.Drawing2D: Created a repository for
System.Drawing.Drawing2D tests.
* ChangeLog: Added.
--- /dev/null
+//\r
+// Tests for System.Drawing.Drawing2D.Blend.cs\r
+//\r
+// Author:\r
+// Ravindra (rkumar@novell.com)\r
+//\r
+// Copyright (C) 2004 Novell, Inc. http://www.novell.com\r
+//
+\r
+using NUnit.Framework;\r
+using System;\r
+using System.Drawing;\r
+using System.Drawing.Drawing2D;\r
+
+namespace MonoTests.System.Drawing
+{
+ [TestFixture]
+ public class BlendTest : Assertion
+ {
+
+ [TearDown]
+ public void TearDown () { }
+
+ [SetUp]
+ public void SetUp () { }
+
+ [Test]
+ public void TestConstructors ()
+ {
+ Blend blend0 = new Blend ();
+
+ AssertEquals ("C#1", 1, blend0.Factors.Length);
+ AssertEquals ("C#2", 1, blend0.Positions.Length);
+
+ Blend blend1 = new Blend (1);
+
+ AssertEquals ("C#3", 1, blend1.Factors.Length);
+ AssertEquals ("C#4", 1, blend1.Positions.Length);
+ }
+
+ [Test]
+ public void TestProperties ()
+ {
+ Blend blend0 = new Blend ();
+
+ AssertEquals ("P#1", 0, blend0.Factors[0]);
+ AssertEquals ("P#2", 0, blend0.Positions[0]);
+
+ Blend blend1 = new Blend (1);
+ float[] positions = {0.0F, 0.5F, 1.0F};\r
+ float[] factors = {0.0F, 0.5F, 1.0F};\r
+ blend1.Factors = factors;\r
+ blend1.Positions = positions;\r
+
+ AssertEquals ("P#3", factors[0], blend1.Factors[0]);
+ AssertEquals ("P#4", factors[1], blend1.Factors[1]);
+ AssertEquals ("P#5", factors[2], blend1.Factors[2]);
+ AssertEquals ("P#6", positions[0], blend1.Positions[0]);
+ AssertEquals ("P#7", positions[1], blend1.Positions[1]);
+ AssertEquals ("P#8", positions[2], blend1.Positions[2]);
+ }
+ }\r
+}
--- /dev/null
+//\r
+// Tests for System.Drawing.Drawing2D.ColorBlend.cs\r
+//\r
+// Author:\r
+// Ravindra (rkumar@novell.com)\r
+//\r
+// Copyright (C) 2004 Novell, Inc. http://www.novell.com\r
+//
+\r
+using NUnit.Framework;\r
+using System;\r
+using System.Drawing;\r
+using System.Drawing.Drawing2D;\r
+
+namespace MonoTests.System.Drawing
+{
+ [TestFixture]
+ public class ColorBlendTest : Assertion
+ {
+
+ [TearDown]
+ public void TearDown () { }
+
+ [SetUp]
+ public void SetUp () { }
+
+ [Test]
+ public void TestConstructors ()
+ {
+ ColorBlend cb0 = new ColorBlend ();
+
+ AssertEquals ("C#1", 1, cb0.Colors.Length);
+ AssertEquals ("C#2", 1, cb0.Positions.Length);
+
+ ColorBlend cb1 = new ColorBlend (1);
+
+ AssertEquals ("C#3", 1, cb1.Colors.Length);
+ AssertEquals ("C#4", 1, cb1.Positions.Length);
+ }
+
+ [Test]
+ public void TestProperties ()
+ {
+ ColorBlend cb0 = new ColorBlend ();
+
+ AssertEquals ("P#1", Color.Empty, cb0.Colors[0]);
+ AssertEquals ("P#2", 0, cb0.Positions[0]);
+
+ ColorBlend cb1 = new ColorBlend (1);
+ float[] positions = {0.0F, 0.5F, 1.0F};\r
+ Color[] colors = {Color.Red, Color.White, Color.Black};\r
+ cb1.Colors = colors;\r
+ cb1.Positions = positions;\r
+
+ AssertEquals ("P#3", colors[0], cb1.Colors[0]);
+ AssertEquals ("P#4", colors[1], cb1.Colors[1]);
+ AssertEquals ("P#5", colors[2], cb1.Colors[2]);
+ AssertEquals ("P#6", positions[0], cb1.Positions[0]);
+ AssertEquals ("P#7", positions[1], cb1.Positions[1]);
+ AssertEquals ("P#8", positions[2], cb1.Positions[2]);
+ }
+ }\r
+}