public void SerializableAddressCompare() { var a1 = new SerializableAddress(address); var a2 = new SerializableAddress(address); Assert.AreEqual(a1, a2); }
public void Overload2() { var serializableAddress = new SerializableAddress(address, displayName, displayNameEncoding); Assert.AreEqual(serializableAddress.DisplayNameCodePage, displayNameEncoding.CodePage); Assert.AreEqual(serializableAddress.Address, address); Assert.AreEqual(serializableAddress.DisplayName, displayName); }
public void MailAddressToSerializableAddress() { var mailAddress = new MailAddress(address, displayName, displayNameEncoding); //implicit conversion SerializableAddress serializableAddress = mailAddress; Assert.AreEqual(serializableAddress.DisplayNameCodePage, displayNameEncoding.CodePage); Assert.AreEqual(serializableAddress.Address, mailAddress.Address); Assert.AreEqual(serializableAddress.DisplayName, mailAddress.DisplayName); }
public void SerializableAddressToMailAddress() { var serializableAddress = new SerializableAddress(address, displayName, displayNameEncoding); //implicit conversion MailAddress mailAddress = serializableAddress; var codePage = CodePageHelper.GetCodePage(mailAddress); Assert.IsTrue(codePage.HasValue); Assert.AreEqual(codePage.Value, displayNameEncoding.CodePage); Assert.AreEqual(mailAddress.Address, serializableAddress.Address); Assert.AreEqual(mailAddress.DisplayName, serializableAddress.DisplayName); }
public void Overload1() { var serializableAddress = new SerializableAddress(address); Assert.AreEqual(serializableAddress.DisplayNameCodePage, Encoding.GetEncoding("utf-8").CodePage); }