1 //
2 // AttachmentCollectionTest.cs - NUnit Test Cases for System.Net.MailAddress.AttachmentCollection
3 //
4 // Authors:
5 //   John Luke (john.luke@gmail.com)
6 //
7 // (C) 2005 John Luke
8 //
9 using NUnit.Framework;
10 using System;
11 using System.IO;
12 using System.Net.Mail;
13 using System.Net.Mime;
14 
15 namespace MonoTests.System.Net.Mail
16 {
17 	[TestFixture]
18 	public class AttachmentCollectionTest
19 	{
20 		AttachmentCollection ac;
21 		Attachment a;
22 
23 		[SetUp]
GetReady()24 		public void GetReady ()
25 		{
26 			ac = new MailMessage ("foo@bar.com", "foo@bar.com").Attachments;
27 			a = Attachment.CreateAttachmentFromString ("test", new ContentType ("text/plain"));
28 		}
29 
30 		[Test]
InitialCount()31 		public void InitialCount ()
32 		{
33 			Assert.IsTrue (ac.Count == 0);
34 		}
35 
36 		[Test]
AddCount()37 		public void AddCount ()
38 		{
39 			ac.Add (a);
40 			Assert.IsTrue (ac.Count == 1);
41 		}
42 
43 		[Test]
RemoveCount()44 		public void RemoveCount ()
45 		{
46 			ac.Remove (a);
47 			Assert.IsTrue (ac.Count == 0);
48 		}
49 	}
50 }
51