X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Drawing%2FTest%2FSystem.Drawing%2FTestStringFormat.cs;h=6e20da75335b9320fe45509ad510dfd993367e40;hb=d1be740678b8f7a411518f7489e74178ac0a726a;hp=31aaf102111b94680eec9e14249229a4a0c5442a;hpb=64f85a65b023522d3f34e9932e6a843e0ad8fc3b;p=mono.git diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs index 31aaf102111..6e20da75335 100644 --- a/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs +++ b/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs @@ -66,22 +66,17 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (ArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void Default_Dispose () { StringFormat sf = new StringFormat (); sf.Dispose (); - sf.ToString (); + Assert.Throws (() => sf.ToString ()); } [Test] - [ExpectedException (typeof (ArgumentNullException))] public void ctor_StringFormat_Null () { - new StringFormat (null); + Assert.Throws (() => new StringFormat (null)); } [Test] @@ -93,9 +88,6 @@ namespace MonoTests.System.Drawing{ } [Test] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void ctor_StringFormatFlags () { using (StringFormat sf = new StringFormat ((StringFormatFlags)Int32.MinValue)) { @@ -104,9 +96,6 @@ namespace MonoTests.System.Drawing{ } [Test] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void ctor_StringFormatFlags_Int32 () { using (StringFormat sf = new StringFormat ((StringFormatFlags) Int32.MinValue, Int32.MinValue)) { @@ -129,15 +118,11 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (ArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void GenericDefault_Local_Dispose () { StringFormat sf = StringFormat.GenericDefault; sf.Dispose (); // can't be cached - CheckDefaults (sf); + Assert.Throws (() => CheckDefaults (sf)); } private void CheckTypographic (StringFormat sf) @@ -167,15 +152,11 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (ArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void GenericTypographic_Local_Dispose () { StringFormat sf = StringFormat.GenericTypographic; sf.Dispose (); // can't be cached - CheckTypographic (sf); + Assert.Throws (() => CheckTypographic (sf)); } [Test] @@ -190,14 +171,10 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (InvalidEnumArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void Alignment_Invalid () { using (StringFormat sf = new StringFormat ()) { - sf.Alignment = (StringAlignment) Int32.MinValue; + Assert.Throws (() => sf.Alignment = (StringAlignment) Int32.MinValue); } } @@ -213,14 +190,10 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (InvalidEnumArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void HotkeyPrefix_Invalid () { using (StringFormat sf = new StringFormat ()) { - sf.HotkeyPrefix = (HotkeyPrefix) Int32.MinValue; + Assert.Throws (() => sf.HotkeyPrefix = (HotkeyPrefix) Int32.MinValue); } } @@ -236,14 +209,10 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (InvalidEnumArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void LineAlignment_Invalid () { using (StringFormat sf = new StringFormat ()) { - sf.LineAlignment = (StringAlignment) Int32.MinValue; + Assert.Throws (() => sf.LineAlignment = (StringAlignment) Int32.MinValue); } } @@ -259,14 +228,10 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (InvalidEnumArgumentException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void Trimming_Invalid () { using (StringFormat sf = new StringFormat ()) { - sf.Trimming = (StringTrimming) Int32.MinValue; + Assert.Throws (() => sf.Trimming = (StringTrimming) Int32.MinValue); } } @@ -281,9 +246,6 @@ namespace MonoTests.System.Drawing{ } [Test] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void Clone_Complex () { using (StringFormat sf = new StringFormat ()) { @@ -321,9 +283,6 @@ namespace MonoTests.System.Drawing{ } [Test] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void TabsStops() { using (StringFormat smf = new StringFormat ()) { @@ -344,21 +303,14 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (NullReferenceException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void SetTabStops_Null () { using (StringFormat sf = new StringFormat ()) { - sf.SetTabStops (Single.NaN, null); + Assert.Throws (() => sf.SetTabStops (Single.NaN, null)); } } [Test] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void SetDigitSubstitution () { using (StringFormat sf = new StringFormat ()) { @@ -369,14 +321,10 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (NullReferenceException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void SetMeasurableCharacterRanges_Null () { using (StringFormat sf = new StringFormat ()) { - sf.SetMeasurableCharacterRanges (null); + Assert.Throws (() => sf.SetMeasurableCharacterRanges (null)); } } @@ -399,15 +347,11 @@ namespace MonoTests.System.Drawing{ } [Test] - [ExpectedException (typeof (OverflowException))] -#if TARGET_JVM - [NUnit.Framework.Category ("NotWorking")] -#endif public void SetMeasurableCharacterRanges_TooBig () { using (StringFormat sf = new StringFormat ()) { CharacterRange[] range = new CharacterRange[33]; - sf.SetMeasurableCharacterRanges (range); + Assert.Throws (() => sf.SetMeasurableCharacterRanges (range)); } } }