示例#1
0
        public void GetFrom()
        {
            // Create the email message.
            var configuration = this.GetValidDefaultConfiguration();
            var emailMessage  = this.CreateEmailMessage(configuration);
            var address       = new MFilesAPI.Extensions.Email.EmailAddress("*****@*****.**", "M-Files Developer Support");

            emailMessage.SetFrom(address);

            // Ensure the from is as specified.
            var from = emailMessage.GetFrom();

            Assert.IsNotNull(from);
            Assert.AreEqual(address.Address, from.Address);
            Assert.AreEqual(address.DisplayName, from.DisplayName);
        }
示例#2
0
        public void SetSender()
        {
            // Create the email message.
            var emailMessage = this.CreateEmailMessage();

            // Create the sender.
            var address = new MFilesAPI.Extensions.Email.EmailAddress("*****@*****.**", "M-Files Developer Support");

            emailMessage.SetSender(address);

            // Ensure the sender is as specified in the configuration.
            var sender = emailMessage.GetSender();

            Assert.IsNotNull(sender);
            Assert.AreEqual(address.Address, sender.Address);
            Assert.AreEqual(address.DisplayName, sender.DisplayName);
        }
示例#3
0
        public void ReplyToList()
        {
            // Create the email message.
            var configuration = this.GetValidDefaultConfiguration();
            var emailMessage  = this.CreateEmailMessage(configuration);
            var address1      = new MFilesAPI.Extensions.Email.EmailAddress("*****@*****.**", "M-Files Developer Support");
            var address2      = new MFilesAPI.Extensions.Email.EmailAddress("*****@*****.**", "M-Files Developer Support");

            emailMessage.SetReplyToList(new List <Extensions.Email.EmailAddress>()
            {
                address1,
                address2
            });

            // Ensure the list is as specified.
            var list = emailMessage.GetReplyToList();

            Assert.IsNotNull(list);
            Assert.AreEqual(2, list.Count);
            Assert.AreEqual(address1.Address, list[0].Address);
            Assert.AreEqual(address1.DisplayName, list[0].DisplayName);
            Assert.AreEqual(address2.Address, list[1].Address);
            Assert.AreEqual(address2.DisplayName, list[1].DisplayName);
        }