New test.
[mono.git] / mcs / class / System / Test / System.Net.Mail / AlternateViewTest.cs
1 //
2 // AlternateViewTest.cs - NUnit Test Cases for System.Net.MailAddress.AlternateView
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.Net.Mail;
14 using System.Net.Mime;
15
16 namespace MonoTests.System.Net.Mail
17 {
18         [TestFixture]
19         public class AlternateViewTest
20         {
21                 AlternateView av;
22                 
23                 [SetUp]
24                 public void GetReady ()
25                 {
26                         av = AlternateView.CreateAlternateViewFromString ("test", new ContentType ("text/plain"));
27                 }
28
29                 [Test]
30                 [ExpectedException (typeof (ArgumentNullException))]
31                 public void ArgumentNullException ()
32                 {
33                         string s = null;
34                         new AlternateView (s);
35                 }
36
37                 [Test]
38                 [ExpectedException (typeof (ArgumentNullException))]
39                 public void ArgumentNullException2 ()
40                 {
41                         Stream s = null;
42                         new AlternateView (s);
43                 }
44
45                 [Test]
46                 public void ContentType ()
47                 {
48                         Assert.IsNotNull (av.ContentType);
49                         Assert.IsTrue (av.ContentType.MediaType == "text/plain");
50                 }
51
52                 [Test]
53                 public void ContentStream ()
54                 {
55                         Assert.IsNotNull (av.ContentStream);
56                         Assert.IsTrue (av.ContentStream.Length == 4);
57                 }
58
59                 [Test]
60                 public void TransferEncoding ()
61                 {
62                         //Assert.IsTrue (av.TransferEncoding = TransferEncoding.QuotedPrintable);
63                 }
64         }
65 }
66 #endif