| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- //
- // MailAddressTest.cs - NUnit Test Cases for System.Net.MailAddress.MailAddress
- //
- // Authors:
- // John Luke ([email protected])
- //
- // (C) 2005 John Luke
- //
- #if NET_2_0
- using NUnit.Framework;
- using System;
- using System.Net.Mail;
- namespace MonoTests.System.Net.Mail
- {
- [TestFixture]
- public class MailAddressTest
- {
- MailAddress address;
-
- [SetUp]
- public void GetReady ()
- {
- address = new MailAddress ("[email protected]", "Mr. Foo Bar");
- }
- [Test]
- public void Address ()
- {
- Assert.IsTrue (address.Address == "[email protected]");
- }
- [Test]
- public void DisplayName ()
- {
- Assert.IsTrue (address.DisplayName == "Mr. Foo Bar");
- }
- [Test]
- public void User ()
- {
- Assert.IsTrue (address.User == "foo");
- }
- [Test]
- public void Host ()
- {
- Assert.IsTrue (address.Host == "example.com");
- }
- [Test]
- public void SimpleToStringTest ()
- {
- Assert.IsTrue (new MailAddress ("[email protected]").ToString () == "[email protected]");
- }
- [Test]
- public void ToStringTest ()
- {
- Assert.IsTrue (address.ToString () == "\"Mr. Foo Bar\" <[email protected]>");
- }
- }
- }
- #endif
|