Ejemplo n.º 1
0
        private static async Task <Tuple <PrimeDnsMapRow, bool> > DoWorkAsync(PrimeDnsMapRow pMapRow, CancellationToken pToken)
        {
            var result = Tuple.Create(pMapRow, false);

            try
            {
                result = await DnsResolver.DnsResolve(pMapRow, pToken);
            }
            catch (Exception e)
            {
                PrimeDns.Log._LogError("DoWorkAsync in Map Updater caused EXCEPTION!", Logger.Logger.ConstDnsResolver, e);
            }
            return(result);
        }
Ejemplo n.º 2
0
        public void TestDnsResolveServFail()
        {
            /*
             *  The following assignments is made to trigger the constructor of PrimeDNS class. It won't work without that.
             */
            var primeDns = new PrimeDns();

            var mapRow = new PrimeDnsMapRow("www.dev5-bing-int1.com");
            var result = Tuple.Create(mapRow, false);

            var source = new CancellationTokenSource();
            var token  = source.Token;

            try
            {
                result = DnsResolver.DnsResolve(mapRow, token).Result;
            }
            catch (Exception e)
            {
                throw new AssertFailedException(e.Message);
            }

            Assert.IsFalse(result.Item2);
        }