Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -1 +1 @@
1d44f318763de5d215b9aaed666c3b779e3f5df9
9674c311abbd4f19156908c4fa3b2d4bc7427100

View File

@@ -325,33 +325,29 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void InterpolationColors_Colors_InvalidBlend ()
{
// default Blend doesn't allow getting this property
Assert.IsNotNull (default_brush.InterpolationColors.Colors);
Assert.Throws<ArgumentException> (() => { var x = default_brush.InterpolationColors.Colors; });
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void InterpolationColors_Positions_InvalidBlend ()
{
// default Blend doesn't allow getting this property
Assert.IsNotNull (default_brush.InterpolationColors.Positions);
Assert.Throws<ArgumentException> (() => { var x = default_brush.InterpolationColors.Positions; });
}
[Test]
[ExpectedException (typeof (IndexOutOfRangeException))]
public void LinearColors_Empty ()
{
default_brush.LinearColors = new Color[0];
Assert.Throws<IndexOutOfRangeException> (() => default_brush.LinearColors = new Color[0]);
}
[Test]
[ExpectedException (typeof (IndexOutOfRangeException))]
public void LinearColors_One ()
{
default_brush.LinearColors = new Color[1];
Assert.Throws<IndexOutOfRangeException> (() => default_brush.LinearColors = new Color[1]);
}
[Test]
@@ -400,10 +396,9 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Transform_Null ()
{
default_brush.Transform = null;
Assert.Throws<ArgumentNullException> (() => default_brush.Transform = null);
}
[Test]
@@ -415,10 +410,9 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Transform_NonInvertible ()
{
default_brush.Transform = new Matrix (123, 24, 82, 16, 47, 30);
Assert.Throws<ArgumentException> (() => default_brush.Transform = new Matrix (123, 24, 82, 16, 47, 30));
}
[Test]
@@ -436,17 +430,15 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void WrapMode_Clamp ()
{
default_brush.WrapMode = WrapMode.Clamp;
Assert.Throws<ArgumentException> (() => default_brush.WrapMode = WrapMode.Clamp);
}
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
public void WrapMode_Invalid ()
{
default_brush.WrapMode = (WrapMode) Int32.MinValue;
Assert.Throws<InvalidEnumArgumentException> (() => default_brush.WrapMode = (WrapMode) Int32.MinValue);
}
@@ -466,17 +458,15 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void MultiplyTransform1_Null ()
{
default_brush.MultiplyTransform (null);
Assert.Throws<ArgumentNullException> (() => default_brush.MultiplyTransform (null));
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void MultiplyTransform2_Null ()
{
default_brush.MultiplyTransform (null, MatrixOrder.Append);
Assert.Throws<ArgumentNullException> (() => default_brush.MultiplyTransform (null, MatrixOrder.Append));
}
[Test]
@@ -486,11 +476,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void MultiplyTransform_NonInvertible ()
{
Matrix noninvertible = new Matrix (123, 24, 82, 16, 47, 30);
default_brush.MultiplyTransform (noninvertible);
Assert.Throws<ArgumentException> (() => default_brush.MultiplyTransform (noninvertible));
}
[Test]
@@ -550,11 +539,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void RotateTransform_InvalidOrder ()
{
LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2);
lgb.RotateTransform (720, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => lgb.RotateTransform (720, (MatrixOrder) Int32.MinValue));
}
[Test]
@@ -603,11 +591,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void ScaleTransform_InvalidOrder ()
{
LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2);
lgb.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => lgb.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue));
}
[Test]
@@ -643,31 +630,27 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_FocusTooSmall ()
{
default_brush.SetBlendTriangularShape (-1);
Assert.Throws<ArgumentException> (() => default_brush.SetBlendTriangularShape (-1));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_FocusTooBig ()
{
default_brush.SetBlendTriangularShape (1.01f);
Assert.Throws<ArgumentException> (() => default_brush.SetBlendTriangularShape (1.01f));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_ScaleTooSmall ()
{
default_brush.SetBlendTriangularShape (1, -1);
Assert.Throws<ArgumentException> (() => default_brush.SetBlendTriangularShape (1, -1));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_ScaleTooBig ()
{
default_brush.SetBlendTriangularShape (1, 1.01f);
Assert.Throws<ArgumentException> (() => default_brush.SetBlendTriangularShape (1, 1.01f));
}
[Test]
@@ -703,31 +686,27 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_FocusTooSmall ()
{
default_brush.SetSigmaBellShape (-1);
Assert.Throws<ArgumentException> (() => default_brush.SetSigmaBellShape (-1));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_FocusTooBig ()
{
default_brush.SetSigmaBellShape (1.01f);
Assert.Throws<ArgumentException> (() => default_brush.SetSigmaBellShape (1.01f));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_ScaleTooSmall ()
{
default_brush.SetSigmaBellShape (1, -1);
Assert.Throws<ArgumentException> (() => default_brush.SetSigmaBellShape (1, -1));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_ScaleTooBig ()
{
default_brush.SetSigmaBellShape (1, 1.01f);
Assert.Throws<ArgumentException> (() => default_brush.SetSigmaBellShape (1, 1.01f));
}
[Test]
@@ -755,11 +734,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void TranslateTransform_InvalidOrder ()
{
LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2);
lgb.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => lgb.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue));
}
[Test]
@@ -875,42 +853,37 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (NullReferenceException))]
public void LinearColors_Null ()
{
default_brush.LinearColors = null;
Assert.Throws<NullReferenceException> (() => default_brush.LinearColors = null);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void InterpolationColors_Null ()
{
default_brush.InterpolationColors = null;
Assert.Throws<ArgumentException> (() => default_brush.InterpolationColors = null);
}
[Test]
[ExpectedException (typeof (NullReferenceException))]
public void Blend_Null ()
{
default_brush.Blend = null;
Assert.Throws<NullReferenceException> (() => default_brush.Blend = null);
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void ZeroWidthRectangle ()
{
Rectangle r = new Rectangle (10, 10, 0, 10);
Assert.AreEqual (0, r.Width, "Width");
new LinearGradientBrush (r, Color.Red, Color.Blue, LinearGradientMode.Vertical);
Assert.Throws<ArgumentException> (() => new LinearGradientBrush (r, Color.Red, Color.Blue, LinearGradientMode.Vertical));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void ZeroHeightRectangleF ()
{
RectangleF r = new RectangleF (10.0f, 10.0f, 10.0f, 0.0f);
Assert.AreEqual (0.0f, r.Height, "Height");
new LinearGradientBrush (r, Color.Red, Color.Blue, LinearGradientMode.Vertical);
Assert.Throws<ArgumentException> (() => new LinearGradientBrush (r, Color.Red, Color.Blue, LinearGradientMode.Vertical));
}
}
}

View File

@@ -36,7 +36,6 @@ using NUnit.Framework;
namespace MonoTests.System.Drawing.Drawing2D {
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class PathGradientBrushTest {
private Point[] pts_2i;
@@ -91,30 +90,27 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_GraphicsPath_Null ()
{
GraphicsPath gp = null;
new PathGradientBrush (gp);
Assert.Throws<ArgumentNullException> (() => new PathGradientBrush (gp));
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void Constructor_GraphicsPath_Empty ()
{
using (GraphicsPath gp = new GraphicsPath ()) {
new PathGradientBrush (gp);
Assert.Throws<OutOfMemoryException> (() => new PathGradientBrush (gp));
}
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void Constructor_GraphicsPath_SinglePoint ()
{
using (GraphicsPath gp = new GraphicsPath ()) {
gp.AddLines (new Point[1] { new Point (1, 1) });
// Special case - a line with a single point is valid
new PathGradientBrush (gp);
Assert.Throws<OutOfMemoryException> (() => new PathGradientBrush (gp));
}
}
@@ -131,27 +127,24 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Point_Null ()
{
Point[] pts = null;
new PathGradientBrush (pts);
Assert.Throws<ArgumentNullException> (() => new PathGradientBrush (pts));
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void Constructor_Point_Empty ()
{
Point[] pts = new Point [0];
new PathGradientBrush (pts);
Assert.Throws<OutOfMemoryException> (() => new PathGradientBrush (pts));
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void Constructor_Point_One ()
{
Point[] pts = new Point[1] { new Point (1, 1) };
new PathGradientBrush (pts);
Assert.Throws<OutOfMemoryException> (() => new PathGradientBrush (pts));
}
[Test]
@@ -209,27 +202,24 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_PointF_Null ()
{
PointF[] pts = null;
new PathGradientBrush (pts);
Assert.Throws<ArgumentNullException> (() => new PathGradientBrush (pts));
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void Constructor_PointF_Empty ()
{
PointF[] pts = new PointF[0];
new PathGradientBrush (pts);
Assert.Throws<OutOfMemoryException> (() => new PathGradientBrush (pts));
}
[Test]
[ExpectedException (typeof (OutOfMemoryException))]
public void Constructor_PointF_One ()
{
PointF[] pts = new PointF[1] { new PointF (1, 1) };
new PathGradientBrush (pts);
Assert.Throws<OutOfMemoryException> (() => new PathGradientBrush (pts));
}
[Test]
@@ -242,10 +232,9 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
public void Constructor_PointF_WrapMode_Invalid ()
{
PathGradientBrush pgb = new PathGradientBrush (pts_2f, (WrapMode)Int32.MinValue);
Assert.Throws<InvalidEnumArgumentException> (() => new PathGradientBrush (pts_2f, (WrapMode)Int32.MinValue));
}
[Test]
@@ -398,11 +387,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SurroundColors_Empty ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.TileFlipXY)) {
pgb.SurroundColors = new Color[0];
Assert.Throws<ArgumentException> (() => pgb.SurroundColors = new Color[0]);
}
}
@@ -448,10 +436,9 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Transform_Null ()
{
new PathGradientBrush (pts_2f, WrapMode.Clamp).Transform = null;
Assert.Throws<ArgumentNullException> (() => new PathGradientBrush (pts_2f, WrapMode.Clamp).Transform = null);
}
[Test]
@@ -464,11 +451,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Transform_NonInvertible ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.Transform = new Matrix (123, 24, 82, 16, 47, 30);
Assert.Throws<ArgumentException> (() => pgb.Transform = new Matrix (123, 24, 82, 16, 47, 30));
}
}
@@ -484,11 +470,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
public void WrapMode_Invalid ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.WrapMode = (WrapMode) Int32.MinValue;
Assert.Throws<InvalidEnumArgumentException> (() => pgb.WrapMode = (WrapMode) Int32.MinValue);
}
}
@@ -507,20 +492,18 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void MultiplyTransform1_Null ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.MultiplyTransform (null);
Assert.Throws<ArgumentNullException> (() => pgb.MultiplyTransform (null));
}
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void MultiplyTransform2_Null ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.MultiplyTransform (null, MatrixOrder.Append);
Assert.Throws<ArgumentNullException> (() => pgb.MultiplyTransform (null, MatrixOrder.Append));
}
}
@@ -533,12 +516,11 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void MultiplyTransform_NonInvertible ()
{
using (Matrix noninvertible = new Matrix (123, 24, 82, 16, 47, 30)) {
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.MultiplyTransform (noninvertible);
Assert.Throws<ArgumentException> (() => pgb.MultiplyTransform (noninvertible));
}
}
}
@@ -607,11 +589,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void RotateTransform_InvalidOrder ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.RotateTransform (720, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => pgb.RotateTransform (720, (MatrixOrder) Int32.MinValue));
}
}
@@ -649,11 +630,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void ScaleTransform_InvalidOrder ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => pgb.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue));
}
}
@@ -692,38 +672,34 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_FocusTooSmall ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetBlendTriangularShape (-1);
Assert.Throws<ArgumentException> (() => pgb.SetBlendTriangularShape (-1));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_FocusTooBig ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetBlendTriangularShape (1.01f);
Assert.Throws<ArgumentException> (() => pgb.SetBlendTriangularShape (1.01f));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_ScaleTooSmall ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetBlendTriangularShape (1, -1);
Assert.Throws<ArgumentException> (() => pgb.SetBlendTriangularShape (1, -1));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetBlendTriangularShape_ScaleTooBig ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetBlendTriangularShape (1, 1.01f);
Assert.Throws<ArgumentException> (() => pgb.SetBlendTriangularShape (1, 1.01f));
}
}
@@ -762,38 +738,34 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_FocusTooSmall ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetSigmaBellShape (-1);
Assert.Throws<ArgumentException> (() => pgb.SetSigmaBellShape (-1));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_FocusTooBig ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetSigmaBellShape (1.01f);
Assert.Throws<ArgumentException> (() => pgb.SetSigmaBellShape (1.01f));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_ScaleTooSmall ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetSigmaBellShape (1, -1);
Assert.Throws<ArgumentException> (() => pgb.SetSigmaBellShape (1, -1));
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetSigmaBellShape_ScaleTooBig ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.SetSigmaBellShape (1, 1.01f);
Assert.Throws<ArgumentException> (() => pgb.SetSigmaBellShape (1, 1.01f));
}
}
@@ -823,11 +795,10 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void TranslateTransform_InvalidOrder ()
{
using (PathGradientBrush pgb = new PathGradientBrush (pts_2f, WrapMode.Clamp)) {
pgb.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => pgb.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue));
}
}
@@ -877,37 +848,34 @@ namespace MonoTests.System.Drawing.Drawing2D {
}
[Test]
[ExpectedException (typeof (NullReferenceException))]
public void Blend_Null ()
{
using (GraphicsPath gp = new GraphicsPath ()) {
gp.AddLines (pts_2f);
using (PathGradientBrush pgb = new PathGradientBrush (gp)) {
pgb.Blend = null;
Assert.Throws<NullReferenceException> (() => pgb.Blend = null);
}
}
}
[Test]
[ExpectedException (typeof (NullReferenceException))]
public void InterpolationColors_Null ()
{
using (GraphicsPath gp = new GraphicsPath ()) {
gp.AddLines (pts_2f);
using (PathGradientBrush pgb = new PathGradientBrush (gp)) {
pgb.InterpolationColors = null;
Assert.Throws<NullReferenceException> (() => pgb.InterpolationColors = null);
}
}
}
[Test]
[ExpectedException (typeof (NullReferenceException))]
public void SurroundColors_Null ()
{
using (GraphicsPath gp = new GraphicsPath ()) {
gp.AddLines (pts_2f);
using (PathGradientBrush pgb = new PathGradientBrush (gp)) {
pgb.SurroundColors = null;
Assert.Throws<NullReferenceException> (() => pgb.SurroundColors = null);
}
}
}

View File

@@ -96,10 +96,9 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (OverflowException))]
public void ColorBlend_Negative ()
{
ColorBlend cb = new ColorBlend (-1);
Assert.Throws<OverflowException> (() => new ColorBlend (-1));
}
[Test]

View File

@@ -38,7 +38,6 @@ using NUnit.Framework;
namespace MonoTests.System.Drawing.Drawing2D
{
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class HatchBrushTest {
Graphics gr;
Bitmap bmp;

View File

@@ -39,16 +39,6 @@ namespace MonoTests.System.Drawing.Drawing2D
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class MatrixTest {
private Matrix default_matrix;
private Rectangle rect;
private RectangleF rectf;
[TestFixtureSetUp]
public void FixtureSetUp ()
{
default_matrix = new Matrix ();
}
[Test]
public void Constructor_Default ()
{
@@ -83,24 +73,21 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Int_Null ()
{
new Matrix (rect, null);
Assert.Throws<ArgumentNullException> (() => new Matrix (default (Rectangle), null));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_Int_Empty ()
{
new Matrix (rect, new Point[0]);
Assert.Throws<ArgumentException> (() => new Matrix (default (Rectangle), new Point[0]));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_Int_4Point ()
{
new Matrix (rect, new Point[4]);
Assert.Throws<ArgumentException> (() => new Matrix (default (Rectangle), new Point[4]));
}
[Test]
@@ -118,24 +105,21 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Float_Null ()
{
new Matrix (rectf, null);
Assert.Throws<ArgumentNullException> (() => new Matrix (default (RectangleF), null));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_Float_Empty ()
{
new Matrix (rectf, new PointF[0]);
Assert.Throws<ArgumentException> (() => new Matrix (default (RectangleF), new PointF[0]));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_Float_2PointF ()
{
new Matrix (rectf, new PointF[2]);
Assert.Throws<ArgumentException> (() => new Matrix (default (RectangleF), new PointF[2]));
}
[Test]
@@ -332,10 +316,9 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Rotate_InvalidOrder ()
{
new Matrix ().Rotate (180, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => new Matrix ().Rotate (180, (MatrixOrder) Int32.MinValue));
}
[Test]
@@ -353,17 +336,15 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void RotateAt_InvalidOrder ()
{
new Matrix ().RotateAt (180, new PointF (10, 10), (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => new Matrix ().RotateAt (180, new PointF (10, 10), (MatrixOrder) Int32.MinValue));
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Multiply_Null ()
{
new Matrix (10, 20, 30, 40, 50, 60).Multiply (null);
Assert.Throws<ArgumentNullException> (() => new Matrix (10, 20, 30, 40, 50, 60).Multiply (null));
}
[Test]
@@ -381,10 +362,9 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Multiply_Null_Order ()
{
new Matrix (10, 20, 30, 40, 50, 60).Multiply (null, MatrixOrder.Append);
Assert.Throws<ArgumentNullException> (() => new Matrix (10, 20, 30, 40, 50, 60).Multiply (null, MatrixOrder.Append));
}
[Test]
@@ -416,11 +396,10 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Multiply_InvalidOrder ()
{
Matrix matrix = new Matrix (10, 20, 30, 40, 50, 60);
matrix.Multiply (new Matrix (10, 20, 30, 40, 50, 60), (MatrixOrder)Int32.MinValue);
Assert.Throws<ArgumentException> (() => matrix.Multiply (new Matrix (10, 20, 30, 40, 50, 60), (MatrixOrder)Int32.MinValue));
}
[Test]
@@ -513,10 +492,9 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Scale_InvalidOrder ()
{
new Matrix ().Scale (2, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => new Matrix ().Scale (2, 1, (MatrixOrder) Int32.MinValue));
}
[Test]
@@ -544,10 +522,9 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Shear_InvalidOrder ()
{
new Matrix ().Shear (-1, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => new Matrix ().Shear (-1, 1, (MatrixOrder) Int32.MinValue));
}
[Test]
@@ -571,31 +548,27 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TransformPoints_Point_Null ()
{
new Matrix ().TransformPoints ((Point[]) null);
Assert.Throws<ArgumentNullException> (() => new Matrix ().TransformPoints ((Point[]) null));
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TransformPoints_PointF_Null ()
{
new Matrix ().TransformPoints ((PointF[]) null);
Assert.Throws<ArgumentNullException> (() => new Matrix ().TransformPoints ((PointF[]) null));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void TransformPoints_Point_Empty ()
{
new Matrix ().TransformPoints (new Point[0]);
Assert.Throws<ArgumentException> (() => new Matrix ().TransformPoints (new Point[0]));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void TransformPoints_PointF_Empty ()
{
new Matrix ().TransformPoints (new PointF[0]);
Assert.Throws<ArgumentException> (() => new Matrix ().TransformPoints (new PointF[0]));
}
[Test]
@@ -619,31 +592,27 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TransformVectors_Point_Null ()
{
new Matrix ().TransformVectors ((Point[]) null);
Assert.Throws<ArgumentNullException> (() => new Matrix ().TransformVectors ((Point[]) null));
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TransformVectors_PointF_Null ()
{
new Matrix ().TransformVectors ((PointF[]) null);
Assert.Throws<ArgumentNullException> (() => new Matrix ().TransformVectors ((PointF[]) null));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void TransformVectors_Point_Empty ()
{
new Matrix ().TransformVectors (new Point[0]);
Assert.Throws<ArgumentException> (() => new Matrix ().TransformVectors (new Point[0]));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void TransformVectors_PointF_Empty ()
{
new Matrix ().TransformVectors (new PointF[0]);
Assert.Throws<ArgumentException> (() => new Matrix ().TransformVectors (new PointF[0]));
}
[Test]
@@ -661,24 +630,21 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Translate_InvalidOrder ()
{
new Matrix ().Translate (-1, 1, (MatrixOrder) Int32.MinValue);
Assert.Throws<ArgumentException> (() => new Matrix ().Translate (-1, 1, (MatrixOrder) Int32.MinValue));
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void VectorTransformPoints_Null ()
{
new Matrix ().VectorTransformPoints ((Point[]) null);
Assert.Throws<ArgumentNullException> (() => new Matrix ().VectorTransformPoints ((Point[]) null));
}
[Test]
[ExpectedException (typeof (ArgumentException))]
public void VectorTransformPoints_Empty ()
{
new Matrix ().VectorTransformPoints (new Point[0]);
Assert.Throws<ArgumentException> (() => new Matrix ().VectorTransformPoints (new Point[0]));
}
}
}