Ejemplo n.º 1
0
        public void TestCase_SMTPService()
        {
            var smtpClient = new Mock <IMailSender>();

            smtpClient.Setup(x => x.SendMail("*****@*****.**", "Welcome User")).Returns(true);
            CustomerCommLib.CustomerComm component = new CustomerCommLib.CustomerComm(smtpClient.Object);
            Assert.AreEqual(true, component.SendMailToCustomer());
        }
        public void OneTimeSetUp(string toaddress, string msg, bool expected)
        {
            mock = new Mock <IMailSender>();

            mock.Setup(p => p.SendMail(toaddress, msg)).Returns(expected);
            obj = new CustomerComm(mock.Object);

            bool actual = obj.SendMailToCustomer();

            Assert.AreEqual(expected, actual);
        }