public void GetSender_TypeIsMailSender() { var stub = Mock.Of <IStatistic>(); _MailService = new SmtpMailService(stub); var address = "*****@*****.**"; var port = 25; var useSsl = true; var login = "******"; var password = "******".Encrypt(); var actual = _MailService.GetSender(address, port, useSsl, login, password); Assert.IsInstanceOfType(actual, typeof(IMailSender)); }
public void GetSender_Give_NotNull_Stub_Test() { var stub = Mock.Of <IStatistic>(); _MailService = new SmtpMailService(stub); var address = "*****@*****.**"; var port = 25; var useSsl = true; var login = "******"; var password = "******".Encrypt(); var expected = new SmtpSender(address, port, useSsl, login, password, stub); var actual = _MailService.GetSender(address, port, useSsl, login, password); Assert.IsNotNull(actual); Assert.AreEqual(expected.ToString(), actual.ToString()); }