* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System / Test / System.Net.Mail / AttachmentTest.cs
1 //
2 // AttachmentTest.cs - NUnit Test Cases for System.Net.MailAddress.Attachment
3 //
4 // Authors:
5 //   John Luke (john.luke@gmail.com)
6 //
7 // (C) 2005 John Luke
8 //
9 #if NET_2_0
10 using NUnit.Framework;
11 using System;
12 using System.IO;
13 using System.Text;
14 using System.Net.Mail;
15
16 namespace MonoTests.System.Net.Mail
17 {
18         [TestFixture]
19         public class AttachmentTest
20         {
21                 Attachment attach;
22                 
23                 [SetUp]
24                 public void GetReady ()
25                 {
26                         attach = Attachment.CreateAttachmentFromString ("test", "text/plain");
27                 }
28
29                 [Test]
30                 [ExpectedException (typeof (ArgumentNullException))]
31                 public void ArgumentNullException ()
32                 {
33                         Stream s = null;
34                         new Attachment (s, "application/octet-stream");
35                 }
36
37                 [Test]
38                 public void ContentDisposition ()
39                 {
40                         Assert.IsNotNull (attach.ContentDisposition);
41                         Assert.IsTrue (attach.ContentDisposition.DispositionType == "attachment");
42                 }
43
44                 [Test]
45                 public void ContentType ()
46                 {
47                         Assert.IsNotNull (attach.ContentType);
48                         Assert.IsTrue (attach.ContentType.MediaType == "text/plain");
49                 }
50
51                 [Test]
52                 public void NameEncoding ()
53                 {
54                         Assert.IsNull (attach.NameEncoding);
55                 }
56
57                 [Test]
58                 public void ContentStream ()
59                 {
60                         Assert.IsNotNull (attach.ContentStream);
61                         Assert.IsTrue (attach.ContentStream.Length == 4);
62                 }
63
64
65                 /*[Test]
66                 public void Name ()
67                 {
68                         Assert.IsNotNull (attach.Name);
69                 }
70
71                 [Test]
72                 public void TransferEncoding ()
73                 {
74                         Assert.IsTrue (attach.TransferEncoding == MimeTransferEncoding.Base64);
75                 }*/
76         }
77 }
78 #endif