}
[Test]
- [ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Brush_Null ()
{
- new Pen ((Brush) null);
+ Assert.Throws<ArgumentNullException> (() => new Pen ((Brush) null));
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Brush_Float_Null ()
{
- new Pen ((Brush) null, Single.MaxValue);
+ Assert.Throws<ArgumentNullException> (() => new Pen ((Brush) null, Single.MaxValue));
}
[Test]
}
[Test]
- [ExpectedException (typeof (SC.InvalidEnumArgumentException))]
public void Alignment_Invalid ()
{
- default_pen.Alignment = (PenAlignment) Int32.MinValue;
+ Assert.Throws<SC.InvalidEnumArgumentException> (() => default_pen.Alignment = (PenAlignment) Int32.MinValue);
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentNullException))]
public void Brush_Null ()
{
- default_pen.Brush = null;
+ Assert.Throws<ArgumentNullException> (() => default_pen.Brush = null);
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
[Category ("NotWorking")] // not supported by libgdiplus
public void CustomEndCap_Default ()
{
- CustomLineCap clc = default_pen.CustomEndCap;
+ Assert.Throws<ArgumentException> (() => { var x = default_pen.CustomEndCap; });
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
[Category ("NotWorking")] // not supported by libgdiplus
public void CustomStartCap_Default ()
{
- CustomLineCap clc = default_pen.CustomStartCap;
+ Assert.Throws<ArgumentException> (() => { var x = default_pen.CustomStartCap; });
}
[Test]
}
[Test]
- [ExpectedException (typeof (SC.InvalidEnumArgumentException))]
public void DashCap_Invalid ()
{
- default_pen.DashCap = (DashCap) Int32.MinValue;
+ Assert.Throws<SC.InvalidEnumArgumentException> (() => default_pen.DashCap = (DashCap) Int32.MinValue);
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void DashPattern_Empty ()
{
- default_pen.DashPattern = new float[0];
+ Assert.Throws<ArgumentException> (() => default_pen.DashPattern = new float[0]);
}
[Test]
}
[Test]
- [ExpectedException (typeof (SC.InvalidEnumArgumentException))]
public void DashStyle_Invalid ()
{
- default_pen.DashStyle = (DashStyle) Int32.MinValue;
+ Assert.Throws<SC.InvalidEnumArgumentException> (() => default_pen.DashStyle = (DashStyle) Int32.MinValue);
}
[Test]
}
[Test]
- [ExpectedException (typeof (OutOfMemoryException))]
[Category ("NotWorking")] // MS bug reported as FDBK50053
public void DashPattern_Default ()
{
- float[] pattern = default_pen.DashPattern;
+ Assert.Throws<OutOfMemoryException> (() => { var x = default_pen.DashPattern; });
}
[Test]
}
[Test]
- [ExpectedException (typeof (SC.InvalidEnumArgumentException))]
public void EndCap_Invalid ()
{
- default_pen.EndCap = (LineCap) Int32.MinValue;
+ Assert.Throws<SC.InvalidEnumArgumentException> (() => default_pen.EndCap = (LineCap) Int32.MinValue);
}
[Test]
}
[Test]
- [ExpectedException (typeof (SC.InvalidEnumArgumentException))]
public void LineJoin_Invalid ()
{
- default_pen.LineJoin = (LineJoin) Int32.MinValue;
+ Assert.Throws<SC.InvalidEnumArgumentException> (() => default_pen.LineJoin = (LineJoin) Int32.MinValue);
}
[Test]
}
[Test]
- [ExpectedException (typeof (SC.InvalidEnumArgumentException))]
public void StartCap_Invalid ()
{
- default_pen.StartCap = (LineCap) Int32.MinValue;
+ Assert.Throws<SC.InvalidEnumArgumentException> (() => default_pen.StartCap = (LineCap) Int32.MinValue);
}
[Test]
- [ExpectedException (typeof (ArgumentNullException))]
public void Transform_Null ()
{
- default_pen.Transform = null;
+ Assert.Throws<ArgumentNullException> (() => default_pen.Transform = null);
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void Transform_NonInvertible ()
{
using (Pen p = new Pen (Brushes.Snow, Single.MaxValue)) {
- p.Transform = new Matrix (123, 24, 82, 16, 47, 30);
+ Assert.Throws<ArgumentException> (() => p.Transform = new Matrix (123, 24, 82, 16, 47, 30));
}
}
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void Dispose ()
{
Pen p = new Pen (Brushes.Red);
p.Dispose ();
- p.Alignment = PenAlignment.Center;
+ Assert.Throws<ArgumentException> (() => p.Alignment = PenAlignment.Center);
// exception but not an ObjectDisposedException
}
[Test]
//[ExpectedException (typeof (ArgumentNullException))] // reported as FDBK50058
- [ExpectedException (typeof (NullReferenceException))]
public void MultiplyTransform1_Null ()
{
- default_pen.MultiplyTransform (null);
+ Assert.Throws<NullReferenceException> (() => default_pen.MultiplyTransform (null));
}
[Test]
//[ExpectedException (typeof (ArgumentNullException))] // reported as FDBK50058
- [ExpectedException (typeof (NullReferenceException))]
public void MultiplyTransform2_Null ()
{
- default_pen.MultiplyTransform (null, MatrixOrder.Append);
+ Assert.Throws<NullReferenceException> (() => default_pen.MultiplyTransform (null, MatrixOrder.Append));
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void MultiplyTransform_NonInvertible ()
{
using (Matrix noninvertible = new Matrix (123, 24, 82, 16, 47, 30)) {
using (Pen p = new Pen (Brushes.Red)) {
- p.MultiplyTransform (noninvertible);
+ Assert.Throws<ArgumentException> (() => p.MultiplyTransform (noninvertible));
}
}
}
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void RotateTransform_InvalidOrder ()
{
- default_pen.RotateTransform (720, (MatrixOrder) Int32.MinValue);
+ Assert.Throws<ArgumentException> (() => default_pen.RotateTransform (720, (MatrixOrder) Int32.MinValue));
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void ScaleTransform_InvalidOrder ()
{
- default_pen.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue);
+ Assert.Throws<ArgumentException> (() => default_pen.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue));
}
[Test]
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
public void TranslateTransform_InvalidOrder ()
{
- default_pen.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue);
+ Assert.Throws<ArgumentException> (() => default_pen.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue));
}
[Test]