2 // AttachmentTest.cs - NUnit Test Cases for System.Net.MailAddress.Attachment
5 // John Luke (john.luke@gmail.com)
10 using NUnit.Framework;
14 using System.Net.Mail;
16 namespace MonoTests.System.Net.Mail
19 public class AttachmentTest
24 public void GetReady ()
26 attach = Attachment.CreateAttachmentFromString ("test", "text/plain");
30 [ExpectedException (typeof (ArgumentNullException))]
31 public void ArgumentNullException ()
34 new Attachment (s, "application/octet-stream");
38 public void ContentDisposition ()
40 Assert.IsNotNull (attach.ContentDisposition);
41 Assert.IsTrue (attach.ContentDisposition.DispositionType == "attachment");
45 public void ContentType ()
47 Assert.IsNotNull (attach.ContentType);
48 Assert.IsTrue (attach.ContentType.MediaType == "text/plain");
52 public void NameEncoding ()
54 Assert.IsNull (attach.NameEncoding);
58 public void ContentStream ()
60 Assert.IsNotNull (attach.ContentStream);
61 Assert.IsTrue (attach.ContentStream.Length == 4);
68 Assert.IsNotNull (attach.Name);
72 public void TransferEncoding ()
74 Assert.IsTrue (attach.TransferEncoding == MimeTransferEncoding.Base64);