Esempio n. 1
0
 public JsonResult GetProvider(string address)
 {
     var e2c = new Email2Provider(address);
     e2c.Resolve();
     Log.Info(String.Format("{0}, {1}", JsonConvert.SerializeObject(address), JsonConvert.SerializeObject(e2c)));
     return Json(e2c, JsonRequestBehavior.AllowGet);
 }
        public void TestResolveFailure()
        {
            var provider = new Email2Provider("");
            Assert.IsNotNull(provider);

            bool success = provider.Resolve();
            Assert.IsFalse(success);

            Assert.AreEqual("Email address is null or empty", provider.FailureReason);
        }
        public void TestResolveMsEmployee()
        {
            var provider = new Email2Provider("*****@*****.**");
            Assert.IsNotNull(provider);

            bool success = provider.Resolve();
            Assert.IsTrue(success);

            Assert.AreEqual(null, provider.FailureReason);

            Assert.AreEqual("Microsoft Exchange", provider.Provider);
        }
        public void TestResolveExchangeSmtp()
        {
            var provider = new Email2Provider("*****@*****.**");
            Assert.IsNotNull(provider);

            bool success = provider.Resolve();
            Assert.IsTrue(success);

            Assert.AreEqual(null, provider.FailureReason);

            Assert.AreEqual("Microsoft Exchange", provider.Provider);
        }
Esempio n. 5
0
        private static void Main(string[] args)
        {
            var email = "";
            if (args.Length < 1 || String.IsNullOrEmpty(args[0])) {
                Console.Write("Enter eamkil address to test: ");
                email = Console.ReadLine();
            }
            else {
                email = args[0];
            }

            var e2c = new Email2Provider(email);
            e2c.Resolve();

            //Console.WriteLine(JsonConvert.SerializeObject(e2c, Formatting.Indented));

            //Console.Write("Press any key to continue...");
            //Console.ReadKey();
        }
        public void TestResolveOffice365()
        {
            var provider = new Email2Provider("*****@*****.**");
            Assert.IsNotNull(provider);

            bool success = provider.Resolve();
            Assert.IsTrue(success);

            Assert.AreEqual(null, provider.FailureReason);

            Assert.AreEqual("Microsoft Exchange", provider.Provider);
        }