}
[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<ArgumentException> (() => sf.ToString ());
}
[Test]
- [ExpectedException (typeof (ArgumentNullException))]
public void ctor_StringFormat_Null ()
{
- new StringFormat (null);
+ Assert.Throws<ArgumentNullException> (() => new StringFormat (null));
}
[Test]
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags)Int32.MinValue)) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags_Int32 ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags) Int32.MinValue, Int32.MinValue)) {
}
[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<ArgumentException> (() => CheckDefaults (sf));
}
private void CheckTypographic (StringFormat sf)
}
[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<ArgumentException> (() => CheckTypographic (sf));
}
[Test]
}
[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<InvalidEnumArgumentException> (() => sf.Alignment = (StringAlignment) Int32.MinValue);
}
}
}
[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<InvalidEnumArgumentException> (() => sf.HotkeyPrefix = (HotkeyPrefix) Int32.MinValue);
}
}
}
[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<InvalidEnumArgumentException> (() => sf.LineAlignment = (StringAlignment) Int32.MinValue);
}
}
}
[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<InvalidEnumArgumentException> (() => sf.Trimming = (StringTrimming) Int32.MinValue);
}
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Clone_Complex ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TabsStops()
{
using (StringFormat smf = new StringFormat ()) {
}
[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<NullReferenceException> (() => sf.SetTabStops (Single.NaN, null));
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetDigitSubstitution ()
{
using (StringFormat sf = new StringFormat ()) {
}
[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<NullReferenceException> (() => sf.SetMeasurableCharacterRanges (null));
}
}
}
[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<OverflowException> (() => sf.SetMeasurableCharacterRanges (range));
}
}
}