diff options
Diffstat (limited to 'mcs/class/System/Test/System.Net.Mail/MailMessageTest.cs')
-rw-r--r-- | mcs/class/System/Test/System.Net.Mail/MailMessageTest.cs | 54 |
1 files changed, 10 insertions, 44 deletions
diff --git a/mcs/class/System/Test/System.Net.Mail/MailMessageTest.cs b/mcs/class/System/Test/System.Net.Mail/MailMessageTest.cs index 5d896053b4d..30d72633a75 100644 --- a/mcs/class/System/Test/System.Net.Mail/MailMessageTest.cs +++ b/mcs/class/System/Test/System.Net.Mail/MailMessageTest.cs @@ -4,7 +4,7 @@ // Authors: // John Luke (john.luke@gmail.com) // -// (C) 2005, 2006 John Luke +// (C) 2005 John Luke // #if NET_2_0 using NUnit.Framework; @@ -30,39 +30,11 @@ namespace MonoTests.System.Net.Mail //Attachment a = Attachment.CreateAttachmentFromString ("blah blah", "text/plain"); //msg.Attachments.Add (a); } - - [Test] - [ExpectedException (typeof (ArgumentNullException))] - public void ArgumentNullCtor1 () - { - new MailMessage (null, "to@example.com"); - } - - [Test] - [ExpectedException (typeof (ArgumentNullException))] - public void ArgumentNullCtor2 () - { - new MailMessage (null, new MailAddress ("to@example.com")); - } - - [Test] - [ExpectedException (typeof (ArgumentNullException))] - public void ArgumentNullCtor3 () - { - new MailMessage ("from@example.com", null); - } - - [Test] - [ExpectedException (typeof (ArgumentNullException))] - public void ArgumentNullCtor4 () - { - new MailMessage (new MailAddress ("from@example.com"), null); - } /*[Test] public void AlternateView () { - Assert.AreEqual (msg.AlternateViews.Count, 1); + Assert.IsTrue (msg.AlternateViews.Count == 1); AlternateView av = msg.AlternateViews[0]; // test that the type is ok, etc. }*/ @@ -70,27 +42,21 @@ namespace MonoTests.System.Net.Mail /*[Test] public void Attachment () { - Assert.AreEqual (msg.Attachments.Count, 1); + Assert.IsTrue (msg.Attachments.Count == 1); Attachment at = msg.Attachments[0]; - Assert.AreEqual (at.ContentType.MediaType, "text/plain"); + Assert.IsTrue (at.ContentType.MediaType == "text/plain"); }*/ [Test] public void Body () { - Assert.AreEqual (msg.Body, "hello"); - } - - [Test] - public void BodyEncoding () - { - Assert.AreEqual (msg.BodyEncoding, Encoding.ASCII); + Assert.IsTrue (msg.Body == "hello"); } [Test] public void From () { - Assert.AreEqual (msg.From.Address, "from@example.com"); + Assert.IsTrue (msg.From.Address == "from@example.com"); } [Test] @@ -102,20 +68,20 @@ namespace MonoTests.System.Net.Mail [Test] public void Priority () { - Assert.AreEqual (msg.Priority, MailPriority.Normal); + Assert.IsTrue (msg.Priority == MailPriority.Normal); } [Test] public void Subject () { - Assert.AreEqual (msg.Subject, "the subject"); + Assert.IsTrue (msg.Subject == "the subject"); } [Test] public void To () { - Assert.AreEqual (msg.To.Count, 1); - Assert.AreEqual (msg.To[0].Address, "to@example.com"); + Assert.IsTrue (msg.To.Count == 1); + Assert.IsTrue (msg.To[0].Address == "to@example.com"); } } } |