AlternateViewCollectionTest.cs 956 B

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