コード例 #1
0
        public void SerializableAddressCompare()
        {
            var a1 = new SerializableAddress(address);
            var a2 = new SerializableAddress(address);

            Assert.AreEqual(a1, a2);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public void Overload1()
        {
            var serializableAddress = new SerializableAddress(address);

            Assert.AreEqual(serializableAddress.DisplayNameCodePage, Encoding.GetEncoding("utf-8").CodePage);
        }