Exemplo n.º 1
0
        public void TestProxyDisabled()
        {
            const int SHIM_HOUR = 3;
            var       now       = DateTime.Now;

            using (ShimsContext.Create())
            {
                System.Fakes.ShimDateTime.NowGet =
                    () => new DateTime(now.Year, now.Month, now.Day, SHIM_HOUR,
                                       now.Minute, now.Second);
                var proxy = new SmtpFacadeProxy();
                proxy.Send(FROM, TO, SUBJECT, BODY);
            }
        }
Exemplo n.º 2
0
        public void TestProxyEnabled()
        {
            const int SHIM_HOUR = 10;
            var       now       = DateTime.Now;

            using (ShimsContext.Create())
            {
                System.Fakes.ShimDateTime.NowGet =
                    () => new DateTime(now.Year, now.Month, now.Day, SHIM_HOUR,
                                       now.Minute, now.Second);
                var proxy = new SmtpFacadeProxy();
                proxy.Send(FROM, TO, SUBJECT, BODY);
                Assert.AreEqual(1, _server.ReceivedEmailCount);
            }
        }