Пример #1
0
        public void Resolve()
        {
            using (var dot = new DotClient())
            {
                var addresses = dot.ResolveAsync("github.com").Result.ToArray();
                Assert.AreNotEqual(0, addresses.Length);

                addresses = dot.ResolveAsync("ipfs.io").Result.ToArray();
                Assert.AreNotEqual(0, addresses.Length);
            }
        }
Пример #2
0
        public async Task Reverse()
        {
            using (var dot = new DotClient())
            {
                var name = await dot.ResolveAsync(IPAddress.Parse("1.1.1.1"));

                Assert.AreEqual("one.one.one.one", name);

                name = await dot.ResolveAsync(IPAddress.Parse("2606:4700:4700::1111"));

                Assert.AreEqual("one.one.one.one", name);
            }
        }
Пример #3
0
        public async Task Resolve_Reverse()
        {
            using (var dot = new DotClient())
            {
                var github    = "github.com";
                var addresses = await dot.ResolveAsync(github);

                foreach (var address in addresses)
                {
                    var name = await dot.ResolveAsync(address);

                    StringAssert.EndsWith(name.ToString(), ".com");
                }
            }
        }
Пример #4
0
 public void Resolve_Unknown()
 {
     using (var dot = new DotClient())
     {
         ExceptionAssert.Throws <IOException>(() =>
         {
             var _ = dot.ResolveAsync("emanon.noname").Result;
         });
     }
 }