New test
authorMarek Safar <marek.safar@gmail.com>
Fri, 2 Dec 2011 15:35:43 +0000 (15:35 +0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 2 Dec 2011 15:40:59 +0000 (15:40 +0000)
mcs/class/System/Test/System.Net.Mail/MailAddressTest.cs

index fd5fcce6bb2ac57307366312413e35153a7c91fc..2b8b0d71811eb7ed3e316479d70de9710f53e950 100644 (file)
@@ -6,7 +6,7 @@
 //
 // (C) 2005 John Luke
 //
-#if NET_2_0
+
 using NUnit.Framework;
 using System;
 using System.Net.Mail;
@@ -203,6 +203,17 @@ namespace MonoTests.System.Net.Mail
                                Assert.IsNull (ex.InnerException, "#H3");
                                Assert.IsNotNull (ex.Message, "#H4");
                        }
+                       
+                       try {
+                               new MailAddress (" ");
+                               Assert.Fail ("#I1");
+                       } catch (FormatException ex) {
+                               // The specified string is not in the form required for an
+                               // e-mail address
+                               Assert.AreEqual (typeof (FormatException), ex.GetType (), "#I2");
+                               Assert.IsNull (ex.InnerException, "#I3");
+                               Assert.IsNotNull (ex.Message, "#I4");
+                       }
                }
 
                [Test]
@@ -349,4 +360,3 @@ namespace MonoTests.System.Net.Mail
                }
        }
 }
-#endif