AttachmentCollectionTest.cs 901 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // AttachmentCollectionTest.cs - NUnit Test Cases for System.Net.MailAddress.AttachmentCollection
  3. //
  4. // Authors:
  5. // John Luke ([email protected])
  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. namespace MonoTests.System.Net.Mail
  15. {
  16. [TestFixture]
  17. public class AttachmentCollectionTest
  18. {
  19. AttachmentCollection ac;
  20. Attachment a;
  21. [SetUp]
  22. public void GetReady ()
  23. {
  24. ac = new MailMessage ("[email protected]", "[email protected]").Attachments;
  25. a = Attachment.CreateAttachmentFromString ("test", new ContentType ("text/plain"));
  26. }
  27. [Test]
  28. public void InitialCount ()
  29. {
  30. Assert.IsTrue (ac.Count == 0);
  31. }
  32. [Test]
  33. public void AddCount ()
  34. {
  35. ac.Add (a);
  36. Assert.IsTrue (ac.Count == 1);
  37. }
  38. [Test]
  39. public void RemoveCount ()
  40. {
  41. ac.Remove (a);
  42. Assert.IsTrue (ac.Count == 0);
  43. }
  44. }
  45. }