public void EmailAddress_HistoryTest() { try { Service.EmailAddressHistoryType eaht = Client.EmailAddress.History("*****@*****.**"); Service.EmailAddressType eat = eaht.emailAddressType; Service.EmailAddressHistoryActionType[] eahat = eaht.emailAddressHistoryActionTypeItems; foreach (Service.EmailAddressHistoryActionType action in eahat) { //action. } } catch (FlexMailException flex) { Assert.AreEqual(223, flex.Code); } }
public void EmailAddress_CreateTest() { try { Service.OptInType optintype = new Service.OptInType() { messageId = 914859, replyEmail = "*****@*****.**", senderEmail = "*****@*****.**", senderName = "Demand", subject = "Opt-In" }; emailaddresstype = new Service.EmailAddressType() { emailAddress = "*****@*****.**", mailingListId = 186569 } ; emailaddresstype.flexmailId = Client.EmailAddress.Create(emailaddresstype, "186569", optintype).ToString(); emailaddresstype.name = "James"; emailaddresstype.surname = "Bond"; emailaddresstype.company = "MI5"; emailaddresstype.function = "Spy"; emailaddresstype.gender = "Male"; emailaddresstype.jobtitle = "Top Secret"; Client.EmailAddress.Update(emailaddresstype, "186569"); //new Client().EmailAddress.Delete(emailaddresstype, "934385"); } catch (FlexMail.Service.FlexMailException flex) { int code = flex.Code; string message = flex.Message; throw; } }