public void ValidationTest() { var emailAccount = new EmailAccount(); emailAccount.Validate(); var clone = emailAccount.Clone(); ValidationTestCore(emailAccount); ValidationTestCore(clone); }
public void CloneTest() { var exchangeSettings = new ExchangeSettings() { UserName = "******" }; var emailAccount = new EmailAccount() { Name = "Harry Thompson", Email = "*****@*****.**", EmailAccountSettings = exchangeSettings }; var clone = emailAccount.Clone(); Assert.AreNotEqual(emailAccount, clone); Assert.AreEqual(emailAccount.Name, clone.Name); Assert.AreEqual(emailAccount.Email, clone.Email); Assert.AreNotEqual(emailAccount.EmailAccountSettings, clone.EmailAccountSettings); Assert.AreEqual(((ExchangeSettings)emailAccount.EmailAccountSettings).UserName, ((ExchangeSettings)clone.EmailAccountSettings).UserName); emailAccount.EmailAccountSettings = null; clone = emailAccount.Clone(); Assert.IsNull(clone.EmailAccountSettings); }